Function ConnectedSocket.accept

draws a new client connection from a listening socket

ConnectedSocket accept (
  out SockAddr clientAddr,
  bool nodelay = true,
  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.
nodelay by default, Nagle algorithm is disabled for TCP connections. Setting this parameter to false reverts to the system-wide configuration.
timeout how long to wait for an incoming 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.