BytesRoad.Net.Sockets.Socket_Socks4.Connect_Connect_End C# (CSharp) Метод

Connect_Connect_End() приватный Метод

private Connect_Connect_End ( IAsyncResult ar ) : void
ar IAsyncResult
Результат void
        void Connect_Connect_End(IAsyncResult ar)
        {
            Connect_SO stateObj = (Connect_SO)ar.AsyncState;
            try
            {
                stateObj.UpdateContext();
                _socket.EndConnect(ar);

                _localEndPoint = null;
                _remoteEndPoint = stateObj.RemoteEndPoint;

                //------------------------------------
                // Send CONNECT command
                //
                byte[] cmd = PrepareConnectCmd(stateObj.RemoteEndPoint);

                NStream.BeginWrite(
                    cmd, 
                    0, 
                    cmd.Length,
                    new AsyncCallback(Connect_Write_End),
                    stateObj);
            }
            catch(Exception e)
            {
                stateObj.Exception = e;
                stateObj.SetCompleted();
            }
        }