private void HandlePingResponse(IPEndPoint endpoint, byte[] data) { Console.WriteLine("Received ping response from: {0}", endpoint); var friend = GetNode(endpoint); if (friend == null) return; var response = new PingResponse(data, friend.SharedKey); if (friend.ContainsPing(response.PingID)) friend.RemovePing(response.PingID); }
private void SendPingResponse(DhtFriend friend, ulong pingID) { var response = new PingResponse(KeyPair.PublicKey, pingID); _net.SendPacket(friend, response); }