Function ConnectedDatagramSocket.accept

draws a new client connection from a listening socket

ConnectedDatagramSocket accept (
  out SockAddr clientAddr,
  Timeout timeout = Timeout(TscTimePoint(9223372036854775807L))
) @nogc @trusted;

This function waits for a client to connect to the socket. Once that happens, it returns with a ConnectedSocket for the new client.

Parameters

NameDescription
clientAddr an out parameter that receives the socket address of the client that connected.
timeout how long to wait for a new connection

Returns

Returns the connected socket.

Throws

ErrnoException if the connection fails (e.g. - EINVAL if accepting from a non-listening socket, or ECONNABORTED if a connection was aborted). Also throws this if one of the system calls fails.

TimeoutExpired if the timeout expires

Anything else: May throw any exception injected using throwInFiber.