public void SerialPut(object data) { Hashtable ht = (Hashtable)data; byte[] key = (byte[])ht["key"]; byte[] value = (byte[])ht["value"]; int ttl = (int)ht["ttl"]; bool expected_result = (bool)ht["result"]; int op = (int)ht["op"]; bool result = false; try { result = default_dht.Put(key, value, ttl); } catch { result = false; } if (result != expected_result) { if (!result) { lock (_lock) { Console.WriteLine("Possible failure from unsuccessful Put: " + op); } } else { lock (_lock) { Console.WriteLine("Possible failure from successful Put: " + op); } } } }
public bool StoreFingerprint() { if (_online) { return(_provider.StoreFingerprint()); } string key = DHTPREFIX + _local_user.Uid; string value = _local_user.DhtKey; try { return(_dht.Put(key, value, DHTTTL)); } catch (Exception e) { ProtocolLog.Write(SocialLog.SVPNLog, e.Message); ProtocolLog.Write(SocialLog.SVPNLog, "DHT PUT FPR FAILURE: " + key); return(false); } }