IFiberConnectionHandler

Standard fiber connection handler class using the basic FiberSelectReader and FiberSelectWriter.

Constructors

this
this(EpollSelectDispatcher epoll, size_t stack_size, bool buffered_writer, ISocket socket, FinalizeDg finalize_dg, ErrorDg error_dg)

Constructor

this
this(EpollSelectDispatcher epoll, bool buffered_writer, ISocket socket, FinalizeDg finalize_dg, ErrorDg error_dg)

Constructor, uses the default fiber stack size.

this
this(EpollSelectDispatcher epoll, size_t stack_size, ISocket socket, FinalizeDg finalize_dg, ErrorDg error_dg)

Constructor, uses the default setting for buffered socket writing.

this
this(EpollSelectDispatcher epoll, ISocket socket, FinalizeDg finalize_dg, ErrorDg error_dg)

Constructor, uses the default fiber stack size and the default setting for buffered socket writing.

Members

Aliases

SelectReader
alias SelectReader = .FiberSelectReader

Local aliases for SelectReader and SelectWriter.

SelectWriter
alias SelectWriter = .FiberSelectWriter
Undocumented in source.

Functions

io_error
bool io_error()

Called by IConnectionHandler.finalize(), in order to determine if an I/O error was reported for the connection conduit which made the connection automatically being closed. (See comment for IConnectionHandler.finalize() method.)

reset
void reset()

Resettable interface method, resets the reader.

Static variables

use_buffered_writer_by_default
bool use_buffered_writer_by_default;

If true, a buffered writer is used by default.

Variables

io_warning
IOWarning io_warning;

IOWarning exception instance used by the reader and writer.

reader
SelectReader reader;

SelectReader and SelectWriter used for asynchronous protocol i/o.

writer
SelectWriter writer;
Undocumented in source.

Inherited Members

From IFiberConnectionHandlerBase

default_stack_size
size_t default_stack_size;

Default fiber stack size (16K in 64-bit builds, 8K in 32-bit builds).

KilledException
alias KilledException = SelectFiber.KilledException

Exception type alias. If handle() catches exceptions, it must rethrow these.

fiber
SelectFiber fiber;

Fiber to handle an single connection.

handleConnection
void handleConnection()

Called by the select listener right after the client connection has been assigned.

formatInfo
void formatInfo(char[] buf)

Formats information about the connection into the provided buffer. This method is called from the SelectListener in order to log information about the state of all connections in the pool.

unregisterSocket
void unregisterSocket()

Called by finalize to unregister the connection socket from epoll before closing it. This is done because closing a socket does not always mean that it is unregistered from epoll -- in situations where the process has forked, the fork's reference to the underlying kernel file description will prevent it from being unregistered until the fork exits. Therefore, to be certain that the socket will not fire again in epoll, we need to explicitly unregister it.

handle
void handle()

Connection handler method. If it catches exceptions, it must rethrow those of type KilledException.

From Resettable

reset
void reset()
Undocumented in source.

Meta