Mentalis.org Security Library documentation

VirtualSocket.EndConnect Method 

Ends a pending asynchronous connection request.

[Visual Basic]
Overridable Public Sub EndConnect( _
   ByVal asyncResult As IAsyncResult _
)
[C#]
public virtual void EndConnect(
   IAsyncResult asyncResult
);

Parameters

asyncResult
Stores state information for this asynchronous operation as well as any user-defined data.

Remarks

To maintain the asynchronous nature of the operation, call this method from the callback delegate. You can pass either the IAsyncResult returned from BeginConnect or the callback delegate used as an input parameter to BeginConnect as the asyncresult parameter. The EndConnect method blocks.

Exceptions

Exception TypeCondition
ArgumentNullExceptionasyncResult is a null reference (Nothing in Visual Basic).
ArgumentExceptionasyncResult was not returned by a call to the BeginConnect method.
InvalidOperationExceptionEndConnect was previously called for the asynchronous connection.
SocketExceptionAn operating system error occurs while accessing the VirtualSocket.
ObjectDisposedExceptionThe VirtualSocket has been closed.

See Also

VirtualSocket Class | VirtualSocket Members | Org.Mentalis.Security.Ssl Namespace