FiberSocketConnection

Undocumented in source.

Constructors

this
this(IPSocket socket, SelectFiber fiber)

Constructor.

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

Constructor.

Members

Aliases

IPSocket
alias IPSocket = AddressIPSocket!(IPv6)

Socket

InAddr
alias InAddr = InetAddress.Addr

Alias of the binary address type, sockaddr_in for IPv4 (IPv6 = false) or sockaddr_in6 for IPv6 (IPv6 = true).

InetAddress
alias InetAddress = .InetAddress!(IPv6)

Alias of the address struct type.

Functions

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(InAddr address, bool force)

Ditto.

in_addr
InAddr in_addr()
port_
ushort port_()
sameAddress
bool sameAddress(InAddr addr)

Compares ip_address_str and port with the current address and port.

sameAddress
bool sameAddress(cstring ip_address_str, ushort port)

Compares ip_address_str and port with the current address and port.

Variables

socket
IPSocket socket;
Undocumented in source.

Inherited Members

From IFiberSocketConnection

This
alias This = typeof(this)

This alias for chainable methods

ConnectionStatus
enum ConnectionStatus

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

socket
IIPSocket socket;

Socket

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.

connected
bool connected()
address
cstring address()
port
ushort port()
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.

disconnect
ConnectionStatus disconnect(bool force)

Disconnects from provided address (if connected).

connect_
ConnectionStatus connect_(bool connect_syscall, bool force)

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

address_
cstring address_()
port_
ushort port_()
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

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.

Examples

alias FiberSocketConnection!(true) IPV6;
alias FiberSocketConnection!(false) IPV4;

Meta