Skip to main content

check_version_compatibility

Function check_version_compatibility 

Source
fn check_version_compatibility(
    stream: &mut TcpStream,
) -> Result<(), HandshakeError>
Expand description

Validates the initial handshake packet sent by a newly connected client.

Verifies the custom magic string protocol identifier, deserializes the client’s version details, compares the protocol hash against the running server version, and transmits the appropriate [HandshakeResponse] back across the stream.

§Arguments

  • stream - A mutable reference to the client’s TcpStream.