Esempio n. 1
0
        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();
        }
Esempio n. 2
0
 public AnpTunnel(string _host, int _port)
 {
     tunnel = new Tunnel(_host, _port);
 }
Esempio n. 3
0
 public AnpTunnel(string _host, int _port)
 {
     tunnel = new Tunnel(_host, _port);
 }