- buffer
- A byte array to store data received from the socket.
- offset
- A int containing the zero-based position in buffer to begin storing the received data.
- size
- A int containing the number of bytes to receive.
- socket_flags
- Documentation for this section has not yet been entered.
- remote_end
- Documentation for this section has not yet been entered.
- callback
- A AsyncCallback delegate, or null.
- state
- An application-defined object, or null.
A IAsyncResult instance that contains information about the asynchronous operation.
Type Reason ArgumentNullException buffer is null.
-or-
remoteEP is null.
ArgumentOutOfRangeException offset < 0.
-or-
offset > buffer.Length.
-or-
size < 0.
-or-
size > buffer.Length - offset.
System.Net.Sockets.SocketException socketFlags is not a valid combination of values.
-or-
An error occurred while accessing the socket.
Note: For additional information on causes of the SocketException, see the System.Net.Sockets.SocketException class.ObjectDisposedException The current instance has been disposed. System.Security.SecurityException A caller in the call stack does not have the required permissions.
To retrieve the results of the operation and release resources allocated by the Socket.BeginReceiveFrom(Byte[], int, int, SocketFlags, System.Net.EndPoint@, AsyncCallback, object) method, call the Socket.EndReceiveFrom(IAsyncResult, System.Net.EndPoint@) method, and specify the IAsyncResult object returned by this method.
If the callback parameter is not null, the method referenced by callback is invoked when the asynchronous operation completes. The IAsyncResult object returned by this method is passed as the argument to the method referenced by callback. The method referenced by callback can retrieve the results of the operation by calling the Socket.EndReceiveFrom(IAsyncResult, System.Net.EndPoint@) method.
The state parameter can be any object that the caller wishes to have available for the duration of the asynchronous operation. This object is available via the IAsyncResult.AsyncState property of the object returned by this method.
For more information, see Socket.ReceiveFrom(Byte[], int, int, SocketFlags, System.Net.EndPoint@), the synchronous version of this method.
Type | Reason |
---|---|
System.Net.SocketPermission |
Requires permission to accept a connection on the endpoint defined by the Socket.LocalEndPoint property of the current instance. See System.Net.NetworkAccess.Accept. Requires permission to make a connection to the endpoint defined by remoteEP. See System.Net.NetworkAccess.Connect. |