BytesRoad.Net.Sockets.Socket_Socks4.Bind_Write_End C# (CSharp) Method

Bind_Write_End() private method

private Bind_Write_End ( IAsyncResult ar ) : void
ar IAsyncResult
return void
        void Bind_Write_End(IAsyncResult ar)
        {
            Bind_SO stateObj = (Bind_SO)ar.AsyncState;
            try
            {
                stateObj.UpdateContext();
                NStream.EndWrite(ar);

                //------------------------------------
                // Read the response from proxy server. 
                //
                NStream.BeginRead(
                    _response, 
                    0, 
                    8, 
                    new AsyncCallback(Bind_Read_End),
                    stateObj);
            }
            catch(Exception e)
            {
                stateObj.Exception = e;
                stateObj.SetCompleted();
            }
        }