Mentalis.org Security Library documentation

VirtualSocket.BeginReceive Method 

Begins to asynchronously receive data from a connected VirtualSocket.

[Visual Basic]
Overridable Public Function BeginReceive( _
   ByVal buffer As Byte(), _
   ByVal offset As Integer, _
   ByVal size As Integer, _
   ByVal socketFlags As SocketFlags, _
   ByVal callback As AsyncCallback, _
   ByVal state As Object _
) As IAsyncResult
[C#]
public virtual IAsyncResult BeginReceive(
   byte[] buffer,
   int offset,
   int size,
   SocketFlags socketFlags,
   AsyncCallback callback,
   object state
);

Parameters

buffer
The storage location for the received data.
offset
The zero-based position in the buffer parameter at which to store the received data.
size
The number of bytes to receive.
socketFlags
A bitwise combination of the SocketFlags values.
callback
The AsyncCallback delegate.
state
An object containing state information for this request.

Return Value

An IAsyncResult that references the asynchronous read.

Remarks

The BeginReceive method starts asynchronously reading data from a VirtualSocket. You must create a callback method that implements the AsyncCallback delegate. This callback method should use the EndReceive method to return the data read from the VirtualSocket.

Exceptions

Exception TypeCondition
ArgumentNullExceptionbuffer is a null reference (Nothing in Visual Basic).
SocketExceptionAn operating system error occurs while accessing the VirtualSocket.
ObjectDisposedExceptionVirtualSocket has been closed.
ArgumentOutOfRangeExceptionoffset is outside the bounds of buffer or size is either smaller or larger than the buffer size.

See Also

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