Skip to main content

dial

Function dial 

Source
pub fn dial<S: Read + Write>(
    config: Arc<ClientConfig>,
    io: S,
) -> Result<(StreamOwned<ClientConnection, S>, PeerIdentity), PeerError>
Expand description

Dials a peer over io, completing the handshake before returning.

Returns the encrypted stream and the verified peer. io is any blocking byte stream. The server name sent is SERVER_NAME; dial_named sends another.

ยงErrors

PeerError::Io when the handshake fails, including a refused peer certificate; PeerError::refusal says why this side refused one.