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

BeginGetHostByName() static private method

static private BeginGetHostByName ( string hostName, AsyncCallback cb, object state ) : IAsyncResult
hostName string
cb AsyncCallback
state object
return IAsyncResult
        static internal IAsyncResult BeginGetHostByName(string hostName, AsyncCallback cb, object state)
        {
            return Dns.BeginGetHostEntry(hostName, cb, state);
        }

Usage Example

        internal override IAsyncResult BeginConnect(string hostName, int hostPort, AsyncCallback callback, object state)
        {
            base.CheckDisposed();
            if (hostName == null)
            {
                throw new ArgumentNullException("hostName", "The value cannot be null.");
            }
            if ((hostPort < 0) || (hostPort > 0xffff))
            {
                throw new ArgumentOutOfRangeException("hostPort", "Value, specified for the port is out of the valid range.");
            }
            Connect_SO t_so = null;

            this.SetProgress(true);
            try
            {
                t_so = new Connect_SO(null, hostName, hostPort, callback, state);
                if (this._resolveHostEnabled)
                {
                    SocketBase.BeginGetHostByName(hostName, new AsyncCallback(this.Connect_GetHost_Host_End), t_so);
                    return(t_so);
                }
                SocketBase.BeginGetHostByName(base._proxyServer, new AsyncCallback(this.Connect_GetHost_Proxy_End), t_so);
            }
            catch (Exception exception)
            {
                this.SetProgress(false);
                throw exception;
            }
            return(t_so);
        }
All Usage Examples Of BytesRoad.Net.Sockets.SocketBase::BeginGetHostByName