Beispiel #1
0
        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);
        }
Beispiel #2
0
            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();
                }
            }
Beispiel #3
0
        public void BeginConnectDest(EndPoint destEndPoint, AsyncCallback callback, object state)
        {
            DestEndPoint = destEndPoint;

            SocketUtil.BeginConnectTcp(destEndPoint, callback, state);
        }