private void Ping(PeerSession session) { if (session.OnPing()) { session.Send(DISCOVER_CHANNEL, discovery.Ping()); } }
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)); } } }
private void HandlePing(PeerSession session) { session.Send(DISCOVER_CHANNEL, discovery.Pong()); }