Share via


Receive Method (Byte[], Int32, Int32, SocketFlags)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Receives the specified number of bytes from a bound Socket into the specified offset position of the receive buffer, using the specified SocketFlags.

Namespace:  System.Net.Sockets
Assembly:  System (in System.dll)

Syntax

'Declaration
Public Function Receive ( _
    buffer As Byte(), _
    offset As Integer, _
    size As Integer, _
    socketFlags As SocketFlags _
) As Integer
public int Receive(
    byte[] buffer,
    int offset,
    int size,
    SocketFlags socketFlags
)
public:
int Receive(
    array<unsigned char>^ buffer, 
    int offset, 
    int size, 
    SocketFlags socketFlags
)
member Receive : 
        buffer:byte[] * 
        offset:int * 
        size:int * 
        socketFlags:SocketFlags -> int 
public function Receive(
    buffer : byte[], 
    offset : int, 
    size : int, 
    socketFlags : SocketFlags
) : int

Parameters

  • buffer
    Type: array<System. . :: . .Byte> [] () [] []
    An array of type Byte that is the storage location for received data.

Return Value

Type: System. . :: . .Int32
The number of bytes received.

Remarks

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.

.NET Framework Security

See Also

Reference

Socket Class

Receive Overload

System.Net.Sockets Namespace