Share via


Socket.Receive Method (Byte[], SocketFlags)

Receives all of the data currently available from a bound socket, according to specified flags, and places the data in a buffer array.

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

Syntax

 public int Receive (
         byte[] buffer,
         SocketFlags socketFlags
)

Parameters

  • buffer
    An array in which the received data is placed.
  • socketFlags
    Bit flags that control the socket's behavior for sending and receiving data. The value of this parameter is a bitwise combination of members of the SocketFlags enumeration.

Return Value

The number of bytes received, if the call was successful; otherwise, -1.

Version Information

Available in .NET Micro Framework version 2.0, 2.5

See Also

Reference

Socket Class
Socket Members
System.Net.Sockets Namespace