Initiates an asynchronous connect operation.
null.null.The IAsyncResult that identifies the posted asynchronous request.
In asynchronous processing, you use BeginConnect to raise the ConnectCompleted event when the connect operation has completed.
To use BeginConnect, create an event handler that processes the results of the asynchronous operation and associate it with your event delegate. BeginConnect initiates an asynchronous connect operation; the ProxyClientBase is notified, through the raising of the ConnectCompleted event, when the connect operation is completed. The ProxyClientBase can then access the connect status by calling EndConnect.
Note: The BeginConnect method returns immediately, but the asynchronous operation is not completed until the event handler is called.
Because BeginConnect is asynchronous, you can call it to receive the connect status without blocking the current thread of execution. To synchronously connect, use the Connect method.
Once an asynchronous operation completes, you can call BeginConnect again in the event handler to keep receiving notifications.
The IAsyncResult that BeginConnect returns identifies the asynchronous operation that the method call started. You can use this IAsyncResult throughout the lifetime of the operation, although you generally do not use it until EndConnect is called. However, if you start several asynchronous operations, you can place their IAsyncResult values in an array and specify whether to wait for all operations or any operation to complete. In this case, you use the AsyncWaitHandle property of the IAsyncResult to identify the completed operation.
IProxyClient Interface | ComponentSpace.Proxy Namespace | IProxyClient.BeginConnect Overload List