mirror of
https://github.com/zhangkong828/DHTSpider.git
synced 2026-10-17 04:30:44 +08:00
24 lines
666 B
C#
24 lines
666 B
C#
using System;
|
|
using Tancoder.Torrent.BEncoding;
|
|
|
|
namespace Tancoder.Torrent.Dht.Messages
|
|
{
|
|
internal class NoTraceMessage : QueryMessage
|
|
{
|
|
private static ResponseCreator creater = crateByType;
|
|
|
|
private static DhtMessage crateByType(BEncodedDictionary dictionary, QueryMessage message)
|
|
{
|
|
var nodes = ((BEncodedDictionary)dictionary["r"]).Keys.Contains("nodes");
|
|
if (nodes)
|
|
return new FindNodeResponse(dictionary, message);
|
|
else
|
|
return null;
|
|
}
|
|
|
|
public NoTraceMessage()
|
|
: base(new BEncodedDictionary(), creater)
|
|
{
|
|
}
|
|
}
|
|
} |