예제 #1
0
 private void Ping(PeerSession session)
 {
     if (session.OnPing())
     {
         session.Send(DISCOVER_CHANNEL, discovery.Ping());
     }
 }
예제 #2
0
 private void SendPort(PeerSession peer, IPEndPoint remote)
 {
     // handle the case where we are on local network and need to send the local port instead of the forwarded port
     if (remote.Address.IsPrivate())
     {
         peer.Send(DISCOVER_CHANNEL, discovery.ServerPort(nodeManager.ServerPort));
         return;
     }
     else
     {
         var port = nodeManager.ForwardedPort;
         if (port != 0)
         {
             peer.Send(DISCOVER_CHANNEL, discovery.ServerPort(port));
         }
     }
 }
예제 #3
0
 private void HandlePing(PeerSession session)
 {
     session.Send(DISCOVER_CHANNEL, discovery.Pong());
 }