public AnnouncePeer(NodeId id, NodeId infoHash, BEncodedNumber port, BEncodedValue token)
     : base(id, QueryName)
 {
     Parameters.Add(InfoHashKey, BEncodedString.FromMemory(infoHash.AsMemory()));
     Parameters.Add(PortKey, port);
     Parameters.Add(TokenKey, token);
 }
Пример #2
0
 protected ResponseMessage(NodeId id, BEncodedValue transactionId)
     : base(ResponseType)
 {
     properties.Add(ReturnValuesKey, new BEncodedDictionary());
     Parameters.Add(IdKey, BEncodedString.FromMemory(id.AsMemory()));
     TransactionId = transactionId;
 }
        protected QueryMessage(NodeId id, BEncodedString queryName, BEncodedDictionary queryArguments)
            : base(QueryType)
        {
            properties.Add(QueryNameKey, queryName);
            properties.Add(QueryArgumentsKey, queryArguments);

            Parameters.Add(IdKey, BEncodedString.FromMemory(id.AsMemory()));
        }
Пример #4
0
 public FindNode(NodeId id, NodeId target)
     : base(id, QueryName)
 {
     Parameters.Add(TargetKey, BEncodedString.FromMemory(target.AsMemory()));
 }
Пример #5
0
 public GetPeers(NodeId id, NodeId infohash)
     : base(id, QueryName)
 {
     Parameters.Add(InfoHashKey, BEncodedString.FromMemory(infohash.AsMemory()));
 }