Skip to main content

Module tcp

Module tcp 

Source
Expand description

The TCP transport: stream framing and a connection pool.

A stream is not a sequence of messages until something makes it one, so each connection owns a [StreamParser] and hands completed messages to the endpoint loop. Connections are pooled and reused, because opening one per request is both slow and, for a peer behind a NAT, impossible in the reverse direction.

Structs§

Pool
A pool of stream connections.
PoolConfig
How the pool is configured.

Enums§

Event
Something that happened on a connection.
Origin
How a connection came to exist, which decides whether it may be reused for outbound requests.

Functions§

accept_loop
Accept connections on a listener, adding each to the pool.