Skip to main content

negotiate

Function negotiate 

Source
pub fn negotiate(
    client: VersionRange,
    host: VersionRange,
) -> Result<u16, ErrorBody>
Expand description

Chooses the highest version in both ranges (session.hello, §6.2).

§Errors

UNSUPPORTED_VERSION carrying host when the ranges do not overlap (or client is empty, min > max). Send it as a version-1 envelope (ResponseEnvelope::error does); the connection stays unnegotiated.