Ends a pending asynchronous read from a specific endpoint.
[Visual Basic]
Overridable Public Function EndReceiveFrom( _
ByVal asyncResult As IAsyncResult, _
ByRef endPoint As EndPoint _
) As Integer
If successful, the number of bytes received. If unsuccessful, returns 0 if the connection is closed by the remote host.
To maintain the asynchronous nature of the operation, call this method from the callback delegate. You can pass either the IAsyncResult returned from BeginReceiveFrom or the callback delegate used as an input parameter to BeginReceiveFrom. as the asyncResult parameter. The EndReceiveFrom method frees any resources allocated by the BeginReceiveFrom method. The EndReceiveFrom method blocks until read ends.
Exception Type | Condition |
---|---|
ArgumentNullException | asyncResult is a null reference (Nothing in Visual Basic). |
ArgumentException | asyncResult was not returned by a call to the BeginReceiveFrom method. |
InvalidOperationException | EndReceiveFrom was previously called for the asynchronous read. |
SocketException | An operating system error occurs while accessing the VirtualSocket. |
ObjectDisposedException | The VirtualSocket has been closed. |
VirtualSocket Class | VirtualSocket Members | Org.Mentalis.Security.Ssl Namespace