Example #1
0
 public DhtPut(Node node, MemBlock key, MemBlock value, int ttl,
     EventHandler finished) : base(finished)
 {
   Node = node;
   Key = key;
   Value = value;
   Ttl = ttl;
   _result = null;
 }
Example #2
0
 public DhtPut(Node node, MemBlock key, MemBlock value, int ttl,
               EventHandler finished) : base(finished)
 {
     Node    = node;
     Key     = key;
     Value   = value;
     Ttl     = ttl;
     _result = null;
 }
Example #3
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 #4
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);
        }