SocketServer

An asynchronous connection server for socket-based connections.

Constructors

this
this()
Undocumented in source.
this
this(Socket[] sockets)

Creates a Server with the given sockets. The sockets must have already had bind and listen called on them.

Members

Classes

Listener
class Listener

Class that actually performs listening on a certain address family

Functions

close
void close()

Stop listening on this socket.

createConnection
SocketConnection createConnection(Socket socket)
Undocumented in source. Be warned that the author may not have intended to support it.
listen
void listen(AddressInfo[] addressInfos)

Start listening on this socket.

updateFlags
void updateFlags()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

handleAccept
void delegate(SocketConnection incoming) handleAccept [@property setter]

Callback for an incoming connection. Connections will not be accepted unless this handler is set.

handleAccept
void delegate(SocketConnection incoming) handleAccept [@property getter]

Callback for an incoming connection. Connections will not be accepted unless this handler is set.

isListening
bool isListening [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
localAddresses
Address[] localAddresses [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

fromStdin
SocketServer fromStdin()

Create a SocketServer using the handle passed on standard input, for which listen had already been called. Used by e.g. FastCGI and systemd sockets with "Listen = yes".

Variables

handleClose
void delegate() handleClose;

Callback for when the socket was closed.

listeners
Listener[] listeners;

Listener instances

listening
bool listening;

Whether the socket is listening.

Meta