Function Socket.recv

recv data from a connected socket

long recv (
  void[] buffer,
  int flags,
  Timeout timeout = Timeout(TscTimePoint(9223372036854775807L))
) @nogc @trusted;

Can be used on unconnected sockets as well, but then it is not possible to know who the sender was.

Parameters

NameDescription
buffer the buffer range to send
flags flags argument as defined for the standard socket recv
timeout how long to wait for data

Returns

The number of bytes actually received

Throws

May throw an ErrnoException in case of error

Will throw TimeoutExpired if the timeout expired