BytesRoad.Net.Sockets.SocketBase.EndGetHostByName C# (CSharp) Method

EndGetHostByName() static private method

static private EndGetHostByName ( IAsyncResult ar ) : IPHostEntry
ar IAsyncResult
return System.Net.IPHostEntry
        static internal IPHostEntry EndGetHostByName(IAsyncResult ar)
        {
            IPHostEntry host = null;
            try
            {
                host = Dns.EndGetHostEntry(ar);
            }
            catch (Exception)
            {
                host = null;
            }

            return host;
        }
        #endregion

Usage Example

        private void Connect_GetHost_Host_End(IAsyncResult ar)
        {
            Connect_SO asyncState = (Connect_SO)ar.AsyncState;

            try
            {
                asyncState.UpdateContext();
                IPHostEntry host = SocketBase.EndGetHostByName(ar);
                if (host != null)
                {
                    asyncState.RemoteEndPoint = SocketBase.ConstructEndPoint(host, asyncState.HostPort);
                }
                SocketBase.BeginGetHostByName(base._proxyServer, new AsyncCallback(this.Connect_GetHost_Proxy_End), asyncState);
            }
            catch (Exception exception)
            {
                asyncState.Exception = exception;
                asyncState.SetCompleted();
            }
        }
All Usage Examples Of BytesRoad.Net.Sockets.SocketBase::EndGetHostByName