internal void SendPingQuery(IPEndPoint address) { fLogger.WriteDebug("Send peer ping {0}", address); var transactionID = DHTHelper.GetTransactionId(); var msg = DHTMessage.CreatePingQuery(transactionID, fLocalID); SetTransaction(transactionID, msg); Send(address, msg); }
public void Test_CreatePingQuery() { var tid = DHTTransactions.GetNextId(); var nodeId = DHTId.CreateRandom(); DHTMessage msg = DHTMessage.CreatePingQuery(tid, nodeId); Assert.IsNotNull(msg); Assert.AreEqual(MessageType.Query, msg.Type); Assert.AreEqual(QueryType.Ping, msg.QueryType); // TODO: test contents }
internal void SendPingQuery(IPEndPoint address, bool async = true) { #if DEBUG_DHT_INTERNALS fLogger.WriteDebug("Send peer ping {0}", address); #endif var transactionID = DHTTransactions.GetNextId(); var msg = DHTMessage.CreatePingQuery(transactionID, fLocalID); fTransactions.SetQuery(transactionID, msg); Send(address, msg, async); }
private void SendPingQuery(IPEndPoint address) { fLogger.WriteDebug("Send peer ping " + address.ToString()); var transactionID = DHTHelper.GetTransactionId(); byte[] nid = fLocalID; BDictionary sendData = DHTMessage.CreatePingQuery(transactionID, nid); SetTransaction(transactionID, new DHTMessage(MsgType.query, QueryType.ping, sendData)); Send(address, sendData); }