TcpServer

An asynchronous TCP connection server.

Constructors

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

Members

Aliases

listen
alias listen = SocketServer.listen
Undocumented in source.

Functions

createConnection
SocketConnection createConnection(Socket socket)
Undocumented in source. Be warned that the author may not have intended to support it.
listen
ushort listen(ushort port, string addr)

Start listening on this socket.

Properties

handleAccept
void delegate(TcpConnection incoming) handleAccept [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

fromStdin
deprecated TcpServer fromStdin()
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From SocketServer

Listener
class Listener

Class that actually performs listening on a certain address family

createConnection
SocketConnection createConnection(Socket socket)
Undocumented in source. Be warned that the author may not have intended to support it.
listening
bool listening;

Whether the socket is listening.

listeners
Listener[] listeners;

Listener instances

updateFlags
void updateFlags()
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.

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

Stop listening on this socket.

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".

handleClose
void delegate() handleClose;

Callback for when the socket was closed.

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

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

Meta