Mentalis.org Security Library documentation

VirtualSocket.EndSendTo Method 

Ends a pending asynchronous send to a specific location.

[Visual Basic]
Overridable Public Function EndSendTo( _
   ByVal asyncResult As IAsyncResult _
) As Integer
[C#]
public virtual int EndSendTo(
   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; 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 BeginSendTo or the callback delegate used as an input parameter to BeginSendTo as the asyncResult parameter. The EndSendTo method frees any resources allocated by the BeginSendTo method. The EndSendTo method blocks until send is complete.
The EndSendTo method frees any resources allocated by the BeginSendTo method.

Exceptions

Exception TypeCondition
ArgumentNullExceptionasyncResult is a null reference (Nothing in Visual Basic).
ArgumentExceptionasyncResult was not returned by a call to the BeginSendTo method.
InvalidOperationExceptionEndSendTo 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