public AsyncPut ( MemBlock key, MemBlock value, int ttl, Channel returns ) : void | ||
key | MemBlock | |
value | MemBlock | |
ttl | int | |
returns | Channel | |
return | void |
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); }
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); }