AsyncTCPListener

Accepts connections on a single IP:PORT tuple by sending a new inbound AsyncTCPConnection object to the handler for every newly completed handshake.

Note: If multiple threads are listening to the same IP:PORT tuple, the connections will be distributed evenly between them. However, this behavior on Windows is not implemented yet.

Constructors

this
this(EventLoop evl, fd_t sock = fd_t.init)

Members

Functions

host
typeof(this) host(string hostname, size_t port)

Sets the local listening interface to the specified hostname/port.

ip
typeof(this) ip(string ip, size_t port)

Sets the local listening interface to the specified ip/port.

kill
bool kill()

Stops accepting connections and cleans up the underlying OS resources.

run
bool run(void delegate(TCPEvent) delegate(AsyncTCPConnection) del)

Starts accepting connections by registering the given handler with the underlying OS event.

Properties

local
NetworkAddress local [@property getter]

Returns the local internet address as an OS-specific structure.

local
NetworkAddress local [@property setter]

Sets the local internet address as an OS-specific structure.

noDelay
bool noDelay [@property setter]

Sets the default value for nagle's algorithm on new connections.

socket
fd_t socket [@property getter]

Use to implement distributed servicing of connections

Meta