Module io

Module io 

Expand description

Low-level I/O helpers for the connection handshake.

Functionsยง

read_packet
Reads from read into reader until one whole packet is framed, returning its fixed header and total on-wire length. The packet stays buffered in reader (decode it with PacketReader::decode, then consume it); any bytes read past it remain buffered too, so the same reader can be handed to the steady-state read loop without losing data.
write_packet
Encodes packet into buf (clearing and reusing it), writes it to writer, then flushes.