示例#1
0
 public AnnouncePeer(NodeId id, NodeId infoHash, BEncodedNumber port, BEncodedString token)
     : base(id, _queryName, _responseCreator)
 {
     Arguments.Add(_infoHashKey, infoHash.BencodedString());
     Arguments.Add(_portKey, port);
     Arguments.Add(_tokenKey, token);
 }
示例#2
0
 public AnnouncePeer(NodeId id, NodeId infoHash, BEncodedNumber port, BEncodedString token)
     : base(id, QueryName, responseCreator)
 {
     Parameters.Add(InfoHashKey, infoHash.BencodedString());
     Parameters.Add(PortKey, port);
     Parameters.Add(TokenKey, token);
 }
示例#3
0
 protected ResponseBase(NodeId id, BEncodedValue transactionId)
     : base(_responseType)
 {
     Properties.Add(_returnValuesKey, new BEncodedDictionary());
     ReturnValues.Add(IdKey, id.BencodedString());
     TransactionId = transactionId;
 }
示例#4
0
 protected ResponseMessage(NodeId id, BEncodedValue transactionId)
     : base(ResponseType)
 {
     properties.Add(ReturnValuesKey, new BEncodedDictionary());
     Parameters.Add(IdKey, id.BencodedString());
     TransactionId = transactionId;
 }
示例#5
0
		public AnnouncePeer(NodeId id, NodeId infoHash, BEncodedNumber port, BEncodedString token)
			: base(id, QueryName, responseCreator)
		{
			Parameters.Add(InfoHashKey, infoHash.BencodedString());
			Parameters.Add(PortKey, port);
			Parameters.Add(TokenKey, token);
		}
示例#6
0
 protected ResponseMessage(NodeId id, BEncodedValue transactionId)
     : base(ResponseType)
 {
     Properties.Add(ReturnValuesKey, new BEncodedDictionary());
     Parameters.Add(IdKey, id.BencodedString());
     TransactionId = transactionId;
 }
示例#7
0
        protected QueryMessage(NodeId id, BEncodedString queryName, BEncodedDictionary queryArguments)
            : base(QueryType)
        {
            properties.Add(QueryNameKey, queryName);
            properties.Add(QueryArgumentsKey, queryArguments);

            Parameters.Add(IdKey, id.BencodedString());
        }
示例#8
0
        protected QueryMessage(NodeId id, BEncodedString queryName, BEncodedDictionary queryArguments, Func <BEncodedDictionary, QueryMessage, ResponseMessage> responseCreator)
            : base(QueryType)
        {
            properties.Add(QueryNameKey, queryName);
            properties.Add(QueryArgumentsKey, queryArguments);

            Parameters.Add(IdKey, id.BencodedString());
            ResponseCreator = responseCreator;
        }
示例#9
0
        protected QueryBase(NodeId id, BEncodedString queryName, BEncodedDictionary queryArguments, Func <BEncodedDictionary, QueryBase, DhtMessage> responseCreator)
            : base(QueryType)
        {
            Properties.Add(_queryNameKey, queryName);
            Properties.Add(_queryArgumentsKey, queryArguments);

            Arguments.Add(IdKey, id.BencodedString());
            ResponseCreator = responseCreator;
        }
示例#10
0
        protected QueryMessage(NodeId id, BEncodedString queryName, BEncodedDictionary queryArguments, ResponseCreator responseCreator)
            : base(QueryType)
        {
            Properties.Add(QueryNameKey, queryName);
            Properties.Add(QueryArgumentsKey, queryArguments);

            Parameters.Add(IdKey, id.BencodedString());
            ResponseCreator = responseCreator;
        }
示例#11
0
 public GetPeers(NodeId id, NodeId infohash)
     : base(id, QueryName, responseCreator)
 {
     Parameters.Add(InfoHashKey, infohash.BencodedString());
 }
示例#12
0
		public GetPeers(NodeId id, NodeId infohash)
			: base(id, QueryName, responseCreator)
		{
			Parameters.Add(InfoHashKey, infohash.BencodedString());
		}
示例#13
0
 public FindNode(NodeId id, NodeId target)
     : base(id, QueryName)
 {
     Parameters.Add(TargetKey, target.BencodedString());
 }
示例#14
0
		public FindNode(NodeId id, NodeId target)
			: base(id, QueryName, responseCreator)
		{
			Parameters.Add(TargetKey, target.BencodedString());
		}
示例#15
0
 public FindNode(NodeId id, NodeId target)
     : base(id, QueryName, InternalResponseCreator)
 {
     Parameters.Add(TargetKey, target.BencodedString());
 }
示例#16
0
 public GetPeers(NodeId id, NodeId infohash)
     : base(id, _queryName, _responseCreator)
 {
     Arguments.Add(_infoHashKey, infohash.BencodedString());
 }
示例#17
0
文件: Vote.cs 项目: Ysovuka/DhtNet
 public Vote(NodeId id, NodeId target, byte vote)
     : base(id, _voteKey, _responseCreator)
 {
     Arguments.Add(_targetKey, target.BencodedString());
     Arguments.Add(_voteKey, new BEncodedNumber(vote));
 }
示例#18
0
 public FindNode(NodeId id, NodeId target)
     : base(id, _queryName, _responseCreator)
 {
     Arguments.Add(_targetKey, target.BencodedString());
 }