protected override void Run() { // Connect the tunnel. InternalAnpTunnel = new AnpTunnel(Host, Port); Tunnel tunnel = InternalAnpTunnel.GetTunnel(); InternalAnpTunnel.BeginConnect(ReconnectHost, ReconnectPort); while (true) { SelectSockets set = new SelectSockets(); set.Timeout = 100; tunnel.CheckTls(); set.AddRead(tunnel.Sock); Block(set); if (set.ReadSockets.Contains(tunnel.Sock)) { InternalAnpTunnel.CreateTransport(); break; } } // Handle the tunnel. OnTunnelConnected(); }
public AnpTunnel(string _host, int _port) { tunnel = new Tunnel(_host, _port); }