TcpServer

An asynchronous TCP connection server.

Constructors

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

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

Members

Functions

close
void close()

Stop listening on this socket.

listen
ushort listen(ushort port, string addr)
void listen(AddressInfo[] addressInfos)

Start listening on this socket.

Properties

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

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

handleAccept
void delegate(TcpConnection 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
TcpServer fromStdin()

Create a TcpServer 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.

Meta