BytesRoad.Net.Sockets.Socket_HttpConnect.Connect_GetPrxHost_End C# (CSharp) Method

Connect_GetPrxHost_End() private method

private Connect_GetPrxHost_End ( IAsyncResult ar ) : void
ar IAsyncResult
return void
        void Connect_GetPrxHost_End(IAsyncResult ar)
        {
            Connect_SO stateObj = (Connect_SO)ar.AsyncState;
            try
            {
                stateObj.UpdateContext();
                IPHostEntry  proxyEntry = EndGetHostByName(ar);
                if(null == proxyEntry)
                    throw new SocketException(SockErrors.WSAHOST_NOT_FOUND);

                    // throw new HostNotFoundException("Unable to resolve proxy name.");

                IPEndPoint proxyEndPoint = ConstructEndPoint(proxyEntry, _proxyPort);

                //------------------------------------------
                // Connect to proxy server
                _socket.BeginConnect(
                    proxyEndPoint, 
                    new AsyncCallback(Connect_Connect_End),
                    stateObj);
            }
            catch(Exception e)
            {
                stateObj.Exception = e;
                stateObj.SetCompleted();
            }
        }