ServerBase

Base class for servers.

Constructors

this
this(EventLoop eventLoop, ServerOptions options)
Undocumented in source.
this
this(ServerOptions options)
Undocumented in source.

Members

Functions

handler
void delegate(TCPEvent) handler(AsyncTCPConnection conn)
Undocumented in source.
host
void host(string ip, ushort port)
void host(string ip)

Binds the server to the given address.

run
void run(bool delegate() condition)

Calls eventLoop.loop until the given condition is true.

run
void run()

Calls eventLoop.loop in an infinite loop.

Properties

defaultPort
ushort defaultPort [@property getter]

Gets the server's default port.

eventLoop
EventLoop eventLoop [@property getter]

Gets the server's event loop. It should be used to run the server.

options
ServerOptions options [@property getter]

Gets the server's options.

router
Router router [@property getter]

Gets the server's router.

Meta