internal void SendGetPeersQuery(IPEndPoint address, byte[] infoHash) { var transactionID = DHTHelper.GetTransactionId(); var msg = DHTMessage.CreateGetPeersQuery(transactionID, fLocalID, infoHash); SetTransaction(transactionID, msg); Send(address, msg); }
private void SendGetPeersQuery(IPEndPoint address, byte[] infoHash) { var transactionID = DHTHelper.GetTransactionId(); byte[] nid = fLocalID; BDictionary sendData = DHTMessage.CreateGetPeersQuery(transactionID, nid, infoHash); SetTransaction(transactionID, new DHTMessage(MsgType.query, QueryType.get_peers, sendData)); Send(address, sendData); }
internal void SendGetPeersQuery(IPEndPoint address, DHTId infoHash) { #if DEBUG_DHT_INTERNALS fLogger.WriteDebug("Send get peers query {0}", address); #endif var transactionID = DHTTransactions.GetNextId(); var msg = DHTMessage.CreateGetPeersQuery(transactionID, fLocalID, infoHash); fTransactions.SetQuery(transactionID, msg); Send(address, msg); }
public void Test_CreateGetPeersQuery() { var tid = DHTTransactions.GetNextId(); var nodeId = DHTId.CreateRandom(); var infoHash = DHTId.CreateRandom(); DHTMessage msg = DHTMessage.CreateGetPeersQuery(tid, nodeId, infoHash); Assert.IsNotNull(msg); Assert.AreEqual(MessageType.Query, msg.Type); Assert.AreEqual(QueryType.GetPeers, msg.QueryType); // TODO: test contents }