示例#1
0
 protected ResponseBase(NodeId id, BEncodedValue transactionId)
     : base(_responseType)
 {
     Properties.Add(_returnValuesKey, new BEncodedDictionary());
     ReturnValues.Add(IdKey, id.BencodedString());
     TransactionId = transactionId;
 }
示例#2
0
 /// <summary>
 /// Adds the values.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="value">The value.</param>
 private void AddValues(T1 key, T2 value)
 {
     _ToString = null;
     lock (LockObject)
     {
         if (!Items.TryGetValue(key, out var ReturnValues))
         {
             ReturnValues = new List <T2>();
             Items.Add(key, ReturnValues);
         }
         ReturnValues.Add(value);
     }
 }
示例#3
0
 public FindNodeResponse(NodeId id, BEncodedValue transactionId)
     : base(id, transactionId)
 {
     ReturnValues.Add(_nodesKey, new BEncodedString());
 }
示例#4
0
 public GetPeersResponse(NodeId id, BEncodedValue transactionId, BEncodedString token)
     : base(id, transactionId)
 {
     ReturnValues.Add(_tokenKey, token);
 }