Ejemplo n.º 1
0
        private void OnBeginAcceptSocket(IAsyncResult async)
        {
            TcpListener listener = async.AsyncState as TcpListener;

            try
            {
                Socket client = listener.EndAcceptSocket(async);
                SocksConnection.DoRequest(this, client, _TunnelConfig);
                if (this.IsStarted)
                {
                    listener.BeginAcceptSocket(this.OnBeginAcceptSocket, listener);
                }
            } catch (ObjectDisposedException)
            {
            } catch (Exception ex)
            {
                LogController.Error("Socks proxy server error: " + ex.Message);
            }
        }