BytesRoad.Net.Sockets.SocketEx.BeginConnect C# (CSharp) Метод

BeginConnect() публичный Метод

Begins an asynchronous connection to the remote host by using specified instance of the System.Net.EndPoint class.
The BeginConnect method starts an asynchronous request for a remote host connection. It returns immediately and does not wait for the asynchronous call to complete.

The BytesRoad.Net.Sockets.SocketEx.EndConnect method is used to retrieve the results of the asynchronous call. It can be called any time after BeginConnect; if the asynchronous call has not completed, EndConnect will block until it completes.

/// The object was disposed. /// /// The remoteEP parameter is null (Nothing in Visual Basic). ///
public BeginConnect ( EndPoint remoteEP, AsyncCallback callback, object state ) : IAsyncResult
remoteEP System.Net.EndPoint /// An instance of the class which /// represents remote end point to connect to. ///
callback AsyncCallback /// The AsyncCallback delegate. ///
state object /// An object containing state information for this request. ///
Результат IAsyncResult
        public IAsyncResult BeginConnect(
            EndPoint remoteEP, 
                                        AsyncCallback callback, 
                                        object state)
        {
            return (IAsyncResult)BeginTimeoutOp(
                _connectTimeout, 
                new ConnectOp(_baseSocket, remoteEP), 
                callback, 
                state);
        }
        

Same methods

SocketEx::BeginConnect ( string hostName, int port, AsyncCallback callback, object state ) : IAsyncResult