protected ResponseBase(NodeId id, BEncodedValue transactionId) : base(_responseType) { Properties.Add(_returnValuesKey, new BEncodedDictionary()); ReturnValues.Add(IdKey, id.BencodedString()); TransactionId = transactionId; }
/// <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); } }
public FindNodeResponse(NodeId id, BEncodedValue transactionId) : base(id, transactionId) { ReturnValues.Add(_nodesKey, new BEncodedString()); }
public GetPeersResponse(NodeId id, BEncodedValue transactionId, BEncodedString token) : base(id, transactionId) { ReturnValues.Add(_tokenKey, token); }