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(); }
public IPEndPoint Sync(PeerInfo peer, string syncId, List<SyncType> syncTypes = null) { var syncer = new Syncer(syncId, syncTypes); var activeIp = syncer.SyncWithPeer(peer, 60000, _udpClient); var udtSocket = SetupUdtSocket(); udtSocket.Bind(_udpClient.Client); udtSocket.Connect(activeIp.Address, activeIp.Port); UdtConnection = udtSocket; UdtConnection.BlockingReceive = true; Logger.Debug("[" + Thread.CurrentThread.ManagedThreadId + "] Successfully completed outgoing tunnel with " + activeIp + "-" + syncId); return activeIp; }
public void SyncWithPeer(PeerInfo peerIp, int timeout) { _syncer = new Syncer(Id); _remoteEndpoint = _syncer.SyncWithPeer(peerIp, timeout, _udpClient); _peer = peerIp; IsTunnelEstablished = true; StartPinger(); }