Function handshake

Source
async fn handshake<R, W>(
    reader: R,
    writer: W,
    version: Version,
    server_fqdn: Option<String>,
) -> Result<()>
where R: AsyncRead + Unpin, W: AsyncWrite + Unpin,
Expand description

Perform the CTP handshake.

To perform the handshake, each endpoint sends the protocol magic number, followed by a Hello message. The Hello message contains information about the originating endpoint that is used by the receiver to validate compatibility with its peer. Only if both endpoints determine that they are compatible does the handshake succeed.