public override DictionaryServiceData Get(byte[] key) { DhtGetResult[] dgrs = _dht.Get(key); DictionaryServiceData results = ConvertToDhtResults(dgrs); return(results); }
/// <summary> /// Returns an array of values (in byte[]) of given name /// </summary> public override DictionaryServiceData Get(byte[] key) { var values = _dht.GetValues(key); DictionaryServiceData results = new DictionaryServiceData(); foreach (object value in values) { DictionaryServiceDataEntry entry = new DictionaryServiceDataEntry(value as byte[]); results.ResultEntries.Add(entry); } return(results); }
private static DictionaryServiceData ConvertToDictionaryServiceData(BigTableDictionaryData[] vals) { var results = new DictionaryServiceData(); foreach (var val in vals) { var entry = new DictionaryServiceDataEntry(val.Value); entry.MetaInfo["timestamp"] = val.Timestamp; results.ResultEntries.Add(entry); } return(results); }
private static DictionaryServiceData ConvertToDhtResults(DhtGetResult[] dgrs) { DictionaryServiceData results = new DictionaryServiceData(); foreach (DhtGetResult dgr in dgrs) { var resultEntry = new DictionaryServiceDataEntry(dgr.value); resultEntry.MetaInfo["ttl"] = dgr.ttl; resultEntry.MetaInfo["age"] = dgr.age; results.ResultEntries.Add(resultEntry); } return(results); }
/// <summary> /// Returns an array of values (in byte[]) of given name /// </summary> public override DictionaryServiceData Get(byte[] key) { var values = _dht.GetValues(key); DictionaryServiceData results = new DictionaryServiceData(); foreach (object value in values) { DictionaryServiceDataEntry entry = new DictionaryServiceDataEntry(value as byte[]); results.ResultEntries.Add(entry); } return results; }
/// <summary> /// Gets the urls to download the torrent file. /// </summary> /// <param name="dictKey">The dict key.</param> /// <returns>The list of urls in byte[] form.</returns> public byte[][] GetUrlsToDownloadTorrent(byte[] dictKey) { DictionaryServiceData results = _dictSvc.Get(dictKey); return(results.Values); }
private static DictionaryServiceData ConvertToDictionaryServiceData(BigTableDictionaryData[] vals) { var results = new DictionaryServiceData(); foreach (var val in vals) { var entry = new DictionaryServiceDataEntry(val.Value); entry.MetaInfo["timestamp"] = val.Timestamp; results.ResultEntries.Add(entry); } return results; }
private static DictionaryServiceData ConvertToDhtResults(DhtGetResult[] dgrs) { DictionaryServiceData results = new DictionaryServiceData(); foreach (DhtGetResult dgr in dgrs) { var resultEntry = new DictionaryServiceDataEntry(dgr.value); resultEntry.MetaInfo["ttl"] = dgr.ttl; resultEntry.MetaInfo["age"] = dgr.age; results.ResultEntries.Add(resultEntry); } return results; }