public bool Connect()
{
try
{
p = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Client = new Client(p, 65535);
Client.Sock.Connect(new IPEndPoint(ipAddress, Port));
//try the greeting.
//Client.onDataReceived += Client_onDataReceived;
if(Socks.DoSocksAuth(this, Username, Password))
if (Socks.SendRequest(Client, enc, Dest, Destport) == SocksError.Granted) {
Client.onDataReceived += Client_onDataReceived;
return true;
}
return false;
}
catch
{
return false;
}
}