public SyncWithPeer ( |
||
peer | ||
timeout | int | |
udpClient | ||
리턴 |
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(); }