ISelectListener

SelectListener base class

Contains all base functionality which is not related to the particular IConnectionHandler subclass used in SelectListener.

Constructors

this
this(sockaddr* address, ISocket socket, int backlog, int protocol)

Constructor

Members

Functions

connection_limit
size_t connection_limit(size_t limit)

Sets the limit of the number of connections. 0 disables the limitation.

connection_limit
size_t connection_limit()
events
Event events()

Implements ISelectClient abstract method.

fileHandle
Handle fileHandle()

Implements ISelectClient abstract method.

getConnectionHandler
IConnectionHandler getConnectionHandler()

Obtains a connection handler instance from the pool.

handle
bool handle(Event event)

I/O event handler

poolInfo
IPoolInfo poolInfo()
shutdown
void shutdown()

Closes all connections and terminates the listener.

terminate
bool terminate()

Closes the server socket and sets this instance to terminated mode.

Inherited Members

From ISelectClient

ISelectable
alias ISelectable = .ISelectable

Convenience alias to avoid public imports

Event
alias Event = Epoll.Event

Enum of event types

FinalizeStatus
enum FinalizeStatus

Enum of the status when finalize() is called.

fileHandle
Handle fileHandle()

I/O device instance

events
Event events()

Events to register the conduit for.

timeout_us
ulong timeout_us;

Connection time out in microseconds. Effective only when used with an EpollSelectDispatcher which has timeouts enabled. A value of 0 has no effect.

expiry_registration
IExpiryRegistration expiry_registration(IExpiryRegistration expiry_registration_)

Sets the timeout manager expiry registration.

timed_out
bool timed_out()
handle
bool handle(Event event)

I/O event handler

timeout
void timeout()

Timeout method, called after a timeout occurs in the SelectDispatcher eventLoop. Intended to be overridden by a subclass if required.

finalize
void finalize(FinalizeStatus status)

Finalize method, called after this instance has been unregistered from the Dispatcher. Intended to be overridden by a subclass if required.

error
void error(Exception exception, Event event)

Error reporting method, called when an Exception is caught from handle(). Calls the error_() method, which should be overridden by a subclass if required.

error_
void error_(Exception exception, Event event)
Undocumented in source. Be warned that the author may not have intended to support it.
error_code
int error_code()

Obtains the current error code of the underlying I/O device.

registered
void registered()

Register method, called after this client is registered with the SelectDispatcher. Intended to be overridden by a subclass if required.

unregistered
void unregistered()

Unregister method, called after this client is unregistered from the SelectDispatcher. Intended to be overridden by a subclass if required.

is_registered
bool is_registered()

Returns true if this.conduit is currently registered for this.events with this as attachment. Returns false if this.conduit is not registered with epoll or, when multiple instances of this class share the same conduit, if it is registered with another instance.

timeout_value_us
ulong timeout_value_us()

ISelectClientInfo method.

registered_
void registered_()

Called by registered(); may be overridden by a subclass.

unregistered_
void unregistered_()

Called by unregistered(); may be overridden by a subclass.

id
cstring id()

Returns an identifier string of this instance. Defaults to the name of the class, but may be overridden if more detailed information is required.

toString
istring toString()

Returns a string describing this client, for use in debug messages.

fmtInfo
void fmtInfo(void delegate(cstring chunk) sink)

Produces a string containing information about this instance: Dynamic type, file descriptor and events.

Meta