IFiberSocketConnection

Undocumented in source.

Constructors

this
this(IIPSocket socket, SelectFiber fiber, IOWarning warning_e, SocketError socket_error)

Constructor.

this
this(IIPSocket socket, SelectFiber fiber)

Constructor.

Members

Aliases

This
alias This = typeof(this)

This alias for chainable methods

Enums

ConnectionStatus
enum ConnectionStatus

Connection status as returned by connect() and disconnect().

Functions

address
cstring address()
address_
cstring address_()
connect
ConnectionStatus connect(cstring address, ushort port, bool force)

Attempts to connect to the remote host, suspending the fiber if establishing the connection does not immediately succeed or fail. If a connection to the same address and port is already established, the Already flag is set in the return value. If a connection to a different address and port is already established, this connection is closed and a new connection is opened.

connect_
ConnectionStatus connect_(bool connect_syscall, bool force)

Establishes a non-blocking socket connection according to the POSIX specification for connect():

connected
bool connected()
disconnect
ConnectionStatus disconnect(bool force)

Disconnects from provided address (if connected).

initSocket
void initSocket()

Called just before the socket is connected. The base class implementation does nothing, but derived classes may override to add any desired initialisation logic.

onDisconnect
void onDisconnect()

Disconnection cleanup handler for a subclass

port
ushort port()
port_
ushort port_()
transmit
bool transmit(Event events)

Called from super.transmitLoop() in two circumstances: 1. Upon the initial call to transmitLoop() in connect(), above. 2. After an epoll wait, upon receipt of one or more registered events.

Variables

connected_
bool connected_;

Current connection status

connection_time_dg
ConnectionTimeDg connection_time_dg;

Delegate which is called (in EpollTiming debug mode) after a socket connection is established.

socket
IIPSocket socket;

Socket

Inherited Members

From IFiberSelectProtocol

SelectFiber
alias SelectFiber = .SelectFiber

Local aliases

IOWarning
alias IOWarning = .IOWarning
Undocumented in source.
IOError
alias IOError = .IOError
Undocumented in source.
conduit
ISelectable conduit;

I/O device

events_
Event events_;

Events to register the I/O device for.

warning_e
IOWarning warning_e;

IOWarning exception instance

error_e
IOError error_e;

IOError exception instance

fileHandle
Handle fileHandle()
events
Event events()
error_code
int error_code()
handle
bool handle(Event events)

Resumes the fiber coroutine and handle the events reported for the conduit. The fiber must be suspended (HOLD state).

transmitLoop
void transmitLoop()

Registers this instance in the select dispatcher and repeatedly calls transmit() until the transmission is finished.

transmit
bool transmit(Event events)

Reads/writes data from/to super.conduit for which events have been reported.

Meta