socks5.Socks5Client.Socks5Client.onConnected C# (CSharp) Method

onConnected() private method

private onConnected ( IAsyncResult res ) : void
res IAsyncResult
return void
        private void onConnected(IAsyncResult res)
        {
            Client = (Client)res.AsyncState;
            try
            {
                Client.Sock.EndConnect(res);
            }
            catch
            {
                this.OnConnected(this, new Socks5ClientArgs(null, SocksError.Failure));
                return;
            }
            if (Socks.DoSocksAuth(this, Username, Password))
            {
                SocksError p = Socks.SendRequest(Client, enc, Dest, Destport);
                Client.onDataReceived += Client_onDataReceived;
                this.OnConnected(this, new Socks5ClientArgs(this, p));
                
            }
            else
                this.OnConnected(this, new Socks5ClientArgs(this, SocksError.Failure));
        }