AsyncPut() public method

public AsyncPut ( MemBlock key, MemBlock value, int ttl, Channel returns ) : void
key MemBlock
value MemBlock
ttl int
returns Channel
return void
Example #1
0
 override public void Start()
 {
   Channel returns = new Channel();
   returns.CloseEvent += delegate(object o, EventArgs ea) {
     try {
       bool success = (bool) returns.Dequeue();
       _result = new DhtPutResult(success, null);
     } catch (Exception e) {
       _result = new DhtPutResult(false, e);
     } finally {
       Finished();
     }
   };
   Dht dht = new Dht(Node, 3, 20);
   dht.AsyncPut(Key, Value, Ttl, returns);
 }
Example #2
0
      public void Start()
      {
        Channel returns = new Channel();
        returns.CloseEvent += delegate(object o, EventArgs ea) {
          try {
            _successful = (bool) returns.Dequeue();
          } catch {
          }

          _done = true;
          if(_callback != null) {
            _callback(this, EventArgs.Empty);
          }
        };
        Dht dht = new Dht(_node, 3, 20);
        dht.AsyncPut(_key, _value, _ttl, returns);
      }