UdpSocket.receive

Receive raw data from a remote peer.

In blocking mode, this function will wait until some bytes are actually received.

Be careful to use a buffer which is large enough for the data that you intend to receive, if it is too small then an error will be returned and all the data will be lost.

  1. Status receive(void[] data, out size_t sizeReceived, out IpAddress address, out ushort port)
    class UdpSocket
    Status
    receive
    (
    void[] data
    ,
    out size_t sizeReceived
    ,,
    out ushort port
    )
  2. Status receive(Packet packet, out IpAddress address, out ushort port)

Parameters

data
Type: void[]

The array to fill with the received bytes

sizeReceived
Type: size_t

The number of bytes received

address
Type: IpAddress

Address of the peer that sent the data

port
Type: ushort

Port of the peer that sent the data

Return Value

Type: Status

Status code.

Meta