Module netservices::resource

source ·
Expand description

The module provides adaptors for networking sessions (see NetSession trait) to become a reactor-managed Resourcees, which can be polled for I/O events in a non-blocking but synchronous mode in a dedicated reactor thread.

The module allows to solve C10k problem with multiple connections by utilizing non-blocking poll sys-calls. It uses the same principle as async runtimes (tokio and others), but provides much simpler API and can run without heap of dependencies introduced by async runtimes.

Structs

A reactor-manageable network listener (TCP, but not limiting to) which can be aware of additional encryption, authentication and other forms of transport-layer protocols which will be automatically injected into accepted connections.
Net transport is an adaptor around specific NetSession (implementing session management, including optional handshake, encoding etc) to be used as a transport resource in a reactor::Reactor.

Enums

An event happening for a NetAccept network listener and delivered to a reactor::Handler.
An event happening for a NetTransport network transport and delivered to a reactor::Handler.
A state of NetTransport network transport.