Skip to main content

drive_stream

Function drive_stream 

Source
pub fn drive_stream<H, T>(
    handshake: H,
    io: &mut T,
) -> Result<Established<H::Output>, DriveError<H::Error>>
where H: Handshake, T: Read + Write,
Expand description

Runs handshake to completion over a blocking byte stream.

A Framing::Stream handshake exchanges its bytes as they are; a Framing::Message handshake has each message prefixed with its length, four big-endian bytes. Nothing is read once the handshake is complete.

ยงErrors

DriveError when the stream fails or closes, or the handshake refuses the peer.