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

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

private Accept_Read_End ( IAsyncResult ar ) : void
ar IAsyncResult
Результат void
        void Accept_Read_End(IAsyncResult ar)
        {
            Accept_SO stateObj = (Accept_SO)ar.AsyncState;
            try
            {
                stateObj.UpdateContext();
                stateObj.ReadBytes += NStream.EndRead(ar);

                if(stateObj.ReadBytes < 8)
                {
                    //------------------------------------
                    // Continue read the response from proxy server. 
                    //
                    NStream.BeginRead(
                        _response, 
                        stateObj.ReadBytes, 
                        8 - stateObj.ReadBytes, 
                        new AsyncCallback(Accept_Read_End),
                        stateObj);
                }
                else
                {
                    VerifyResponse();
                    stateObj.SetCompleted();
                }
            }
            catch(Exception e)
            {
                stateObj.Exception = e;
                stateObj.SetCompleted();
            }
        }