Beispiel #1
0
        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);
        }
Beispiel #2
0
        public void Test_DHTTransactions_class()
        {
            var instance = new DHTTransactions();

            Assert.IsNotNull(instance);

            var tid = DHTTransactions.GetNextId();
            var msg = new DHTMessage(MessageType.Query, QueryType.Ping, null);

            instance.SetQuery(tid, msg);
            Assert.AreEqual(QueryType.Ping, instance.CheckQuery(tid));
        }