Function Socket.recvObj

recv whole object from a connected socket

void recvObj(T) (
  T* data,
  int flags = 0,
  Timeout timeout = Timeout.infinite
) @nogc @safe;

void recvObj(T) (
  T* data,
  Timeout timeout
) @nogc @safe;

Can be used on unconnected sockets as well, but then it is not possible to know who the sender was. This form of the call is intended for recieving object of absolute know size.

Parameters

NameDescription
data pointer to data to be received.
flags flags ardument as defined for the standard socket recv
timeout timeout

Throws

May throw an ErrnoException in case of a socket error. If amount of bytes received is not identical to sizeof(T), will throw ShortRead excetpion, which inherits from ErrnoException with errno set to EREMOTEIO (remote IO error).

Will throw TimeoutExpired if the timeout expired