Mentalis.org Security Library documentation

VirtualSocket.EndReceive Method 

Ends a pending asynchronous read.

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

Parameters

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

Return Value

The number of bytes received.

Remarks

To maintain the asynchronous nature of the operation, call this method from the callback delegate. You can pass either the IAsyncResult returned from BeginReceive or the callback delegate used as an input parameter to BeginReceive as the asyncResult parameter. The EndReceive method blocks until the read ends.

Exceptions

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

See Also

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