pub async fn server_handshake_client<'a, RW: 'a>(
    conn: &'a mut RW,
    nix_version: &str,
    trusted: Trust,
) -> Result<ProtocolVersion>
Expand description

Performs the initial handshake the server is sending to a connecting client.

During the handshake, the client first send a magic u64, to which the daemon needs to respond with another magic u64. Then, the daemon retrieves the client version, and discards a bunch of now obsolete data.

§Arguments

  • conn: connection with the Nix client.
  • nix_version: semantic version of the Nix daemon. “2.18.2” for instance.
  • trusted: trust level of the Nix client.

§Return

The protocol version to use for further comms, min(client_version, our_version).