Skip to main content

Module socket

Module socket 

Source
Expand description

Client and server socket APIs.

Client: build a ClientSocket with ClientSocketBuilder; call send_bytes / receive_bytes.

Server: build a Listener with ListenerBuilder, call start(), then accept() in a loop to obtain ClientHandles. Each handle corresponds to one connected client.

Decoy providers can be customised per-flow on the server (via ServerFlowConfiguration::with_decoy) or globally on the builder (via with_decoy / with_decoy_factory). The default is random_decoy_factory(), which selects among all five built-in providers at random.

Re-exports§

pub use crate::certificate::ClientCertificate;
pub use crate::certificate::ServerKeyPair;

Structs§

ClientHandle
Handle to a connected client, providing send/receive operations. Not cloneable — only one handle per connection.
ClientSocket
Client-side TYPHOON socket providing send/receive operations.
ClientSocketBuilder
Builder for constructing a ClientSocket.
Listener
Server-side listener that drives the handshake path and produces ClientHandles. All routing and session lifecycle state lives in the shared [Router].
ListenerBuilder
Builder for constructing a Listener.
ServerFlowConfiguration
Configuration for a single server flow manager.

Enums§

ClientSocketError
ServerSocketError

Traits§

ClientConnectionHandler
Client-side connection handler: produces client initial data and the version bytes for the handshake.
ServerConnectionHandler
Server-side connection handler: generates identities, produces server initial data, and checks client version.