/// <summary>
 /// Starts negotiating asynchronously with the SOCKS server.
 /// </summary>
 /// <param name="remoteEP">An IPEndPoint that represents the remote device.</param>
 /// <param name="callback">The method to call when the negotiation is complete.</param>
 /// <param name="proxyEndPoint">The IPEndPoint of the SOCKS proxy server.</param>
 /// <returns>An IAsyncProxyResult that references the asynchronous connection.</returns>
 public override IAsyncProxyResult BeginNegotiate(IPEndPoint remoteEP, HandShakeComplete callback, IPEndPoint proxyEndPoint)
 {
     ProtocolComplete = callback;
     HandShake        = GetEndPointBytes(remoteEP);
     Server.BeginConnect(proxyEndPoint, new AsyncCallback(this.OnConnect), Server);
     AsyncResult = new IAsyncProxyResult();
     return(AsyncResult);
 }
 /// <summary>
 /// Starts negotiating asynchronously with the SOCKS server.
 /// </summary>
 /// <param name="host">The host to connect to.</param>
 /// <param name="port">The port to connect to.</param>
 /// <param name="callback">The method to call when the negotiation is complete.</param>
 /// <param name="proxyEndPoint">The IPEndPoint of the SOCKS proxy server.</param>
 /// <returns>An IAsyncProxyResult that references the asynchronous connection.</returns>
 public override IAsyncProxyResult BeginNegotiate(string host, int port, HandShakeComplete callback, IPEndPoint proxyEndPoint)
 {
     ProtocolComplete = callback;
     HandShake        = GetHostPortBytes(host, port);
     Server.BeginConnect(proxyEndPoint, new AsyncCallback(this.OnConnect), Server);
     AsyncResult = new IAsyncProxyResult();
     return(AsyncResult);
 }