public void BeginConnectProxy(EndPoint remoteEP, AsyncCallback callback, object state) { var st = new Socks5State(); st.Callback = callback; st.AsyncState = state; ProxyEndPoint = remoteEP; SocketUtil.BeginConnectTcp(remoteEP, ConnectCallback, st); }
public void Start(byte[] firstPacket, int length, Socket socket, int targetPort) { this._firstPacket = firstPacket; this._firstPacketLength = length; this._local = socket; try { EndPoint remoteEP = SocketUtil.GetEndPoint("localhost", targetPort); // Connect to the remote endpoint. SocketUtil.BeginConnectTcp(remoteEP, ConnectCallback, null); } catch (Exception e) { Logging.LogUsefulException(e); this.Close(); } }
public void BeginConnectDest(EndPoint destEndPoint, AsyncCallback callback, object state) { DestEndPoint = destEndPoint; SocketUtil.BeginConnectTcp(destEndPoint, callback, state); }