public IPEndPoint WaitForSync(PeerInfo peer, String syncId, List<SyncType> syncTypes = null) { var syncer = new Syncer(syncId, syncTypes); var activeIp = syncer.WaitForSyncFromPeer(peer, 60000, _udpClient); ListeningSocket = SetupUdtSocket(); ListeningSocket.Bind(_udpClient.Client); ListeningSocket.Listen(10); Udt.Socket udtClient = ListeningSocket.Accept(); UdtConnection = udtClient; UdtConnection.BlockingReceive = true; Logger.Debug("Successfully completed incoming tunnel with " + activeIp + "-" + syncId); return activeIp; }
public void WaitForSyncFromPeer(PeerInfo peerIp, int timeout) { _syncer = new Syncer(Id); _remoteEndpoint = _syncer.WaitForSyncFromPeer(peerIp, timeout, _udpClient); _peer = peerIp; IsTunnelEstablished = true; StartCheckerForPings(); }