Mentalis.org Security Library documentation

VirtualSocket.EndSend Method 

Ends a pending asynchronous send.

[Visual Basic]
Overridable Public Function EndSend( _
   ByVal asyncResult As IAsyncResult _
) As Integer
[C#]
public virtual int EndSend(
   IAsyncResult asyncResult
);

Parameters

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

Return Value

If successful, the number of bytes sent to the VirtualSocket; otherwise, an invalid VirtualSocket error.

Remarks

To maintain the asynchronous nature of the operation, call this method from the callback delegate. You can pass either the IAsyncResult returned from BeginSend or the callback delegate used as an input parameter to BeginSend as the asyncResult parameter. The EndSend method frees any resources allocated by the BeginSend method. The EndSend method blocks until the send ends.
The EndSend method frees any resources allocated by the BeginSend method.

Exceptions

Exception TypeCondition
ArgumentNullExceptionasyncResult is a null reference (Nothing in Visual Basic).
ArgumentExceptionasyncResult was not returned by a call to the BeginSend method.
InvalidOperationExceptionEndSend was previously called for the asynchronous read.
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