0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-28 00:14:07 +01:00
construct/include/ircd/net
2018-01-22 00:54:51 -08:00
..
acceptor.h ircd::net: Move acceptor into header; minor cleanup. 2018-01-19 06:55:48 -08:00
asio.h ircd: Fwd declare boost::system::error_code; minor cleanup. 2018-01-08 03:08:59 -08:00
close.h ircd::net: Rename sockopts to sock_opts. 2018-01-07 02:02:41 -08:00
hostport.h ircd::net: Improve remote construction; hostport/ipport related. 2018-01-10 01:20:16 -08:00
ipport.h ircd::net: Improve remote construction; hostport/ipport related. 2018-01-10 01:20:16 -08:00
listener.h ircd::net: listener: Explicit string ctor; no default port to ensure one is specified. 2017-11-30 11:23:47 -08:00
net.h ircd::net: Develop interface for async_wait / waiting on socket. 2018-01-08 13:25:13 -08:00
open.h ircd: Adjust some default timeouts. 2018-01-22 00:54:51 -08:00
read.h ircd::net: Update read()/write() strategies. 2018-01-14 20:45:30 -08:00
README.md ircd::net: Update read()/write() strategies. 2018-01-14 20:45:30 -08:00
remote.h ircd::net: Add remote to hostport conversion. 2018-01-19 04:54:14 -08:00
resolve.h ircd::net: Add RFC1035 preliminary stub; minor reorg of resolver related. 2018-01-14 20:45:30 -08:00
sock_opts.h ircd::net: Rename sockopts to sock_opts. 2018-01-07 02:02:41 -08:00
socket.h ircd::net: Translate operation_canceled into timed_out where appropos. 2018-01-20 13:59:24 -08:00
wait.h ircd::net: Improve wait related; fix issues with bad behavior. 2018-01-08 18:33:05 -08:00
write.h ircd::net: Update read()/write() strategies. 2018-01-14 20:45:30 -08:00

IRCd Networking

open()

The open() call combines DNS resolution, TCP connecting and SSL handshaking. A dedicated options structure is provided to tweak the specifics of the process.

close()

Like the open() sequence, the close() sequence composes a complex of multiple operations to close_notify the SSL session with cryptographic soundness and then disconnect the TCP session. A dedicated options structure is provided to tweak details.

Conveyance

Four strategies are available to work with the socket. We have it all covered. The read() and write() suites contain functions postfixed by their behavior:

_all()

A call to read_all() or write_all() will yield the calling ircd::ctx until the supplied buffers are filled or transmitted, respectively.

It is strongly advised to set a timeout in the options structure when making calls of this type.

An ircd::ctx is required to make this call, it does not work on the main stack.

_few()

A call to *_few() also yields the ircd::ctx, but the yield only lasts until some data is sent or received. Once some activity takes place, as much as possible is accomplished; there will not be any more yielding.

It is strongly advised to set a timeout in the options structure when making calls of this type.

An ircd::ctx is required to make this call, it does not work on the main stack.

_any()

A call to *_any() has true non-blocking behavior. It does not require an ircd::ctx. This call tries to conduct as much IO as possible without blocking. Internally it may be a loop of the _one() strategy that works through as much of the buffers until error.

_one()

A call to *_one() also has true non-blocking behavior and does not require an ircd::ctx. This call makes one syscall which may not fill or transmit all of the user buffers even if the kernel has more capacity to do so. To maximize the amount of data read or written to kernelland use the _any() strategy.