Socket.recvObj

recv whole object from a connected socket

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.

  1. void recvObj(T* data, int flags, Timeout timeout)
    struct Socket
    @safe @nogc
    void
    recvObj
    (
    T
    )
    if (
    !hasElaborateDestructor!T
    )
  2. void recvObj(T* data, Timeout timeout)

Parameters

data T*

pointer to data to be received.

flags int

flags ardument as defined for the standard socket recv

timeout 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

Meta