Receives data from a socket.
- buf
- A byte array to store data received from the socket.
A int containing the number of bytes received.
Type Reason System.Net.SocketPermission Requires permission to accept connections. See System.Net.NetworkAccess.Accept.
Type Reason ArgumentNullException buffer is null. InvalidOperationException An asynchronous call is pending and a blocking method has been called. System.Net.Sockets.SocketException An error occurred while accessing the socket.
Note: For additional information on causes of the SocketException, see the System.Net.Sockets.SocketException class.System.Security.SecurityException A caller in the call stack does not have the required permissions. ObjectDisposedException The current instance has been disposed.
This method is equivalent to Socket.Receive(Byte[], int, SocketFlags)(buffer, 0, buffer.Length, SocketFlags.None).
Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0