ConnectedSocket.accept

draws a new client connection from a listening socket

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

struct ConnectedSocket
@trusted @nogc
accept
(
out SockAddr clientAddr
,
bool nodelay = true
,)

Parameters

clientAddr SockAddr

an out parameter that receives the socket address of the client that connected.

nodelay bool

by default, Nagle algorithm is disabled for TCP connections. Setting this parameter to false reverts to the system-wide configuration.

timeout Timeout

how long to wait for an incoming connection

Return Value

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.

Meta