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

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]

Delegate to be called when a connection is accepted.

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

datagram
bool datagram;
Undocumented in source.
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]

Returns all listening addresses.

isListening
bool isListening [@property getter]

Returns true if the server is listening for incoming connections.

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