Receive Method (Byte[], SocketFlags)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Receives data from a bound Socket into a receive buffer, using the specified SocketFlags.
Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Parameters
- buffer
- Type: array<System..::..Byte>[]()[][]
An array of type Byte that is the storage location for the received data.
- socketFlags
- Type: System.Net.Sockets..::..SocketFlags
A bitwise combination of the SocketFlags values.
The Receive method reads data into the buffer parameter and returns the number of bytes successfully read. You can call Receive from both connection-oriented and connectionless sockets.
This overload only requires you to provide a receive buffer and the necessary SocketFlags. The buffer offset defaults to 0, and the size defaults to the length of the byte parameter.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.