Skip to main content

encode_retire

Function encode_retire 

Source
pub fn encode_retire(version: u32) -> String
Expand description

What: The line that asks a service to retire, written in the protocol version that service speaks. Why: A service reads a line only in its own version, except that services built with this check read a retire at any version. A service of an earlier release (the ones that sent no release in their greeting) refuses a retire written in a newer version as unsupported and stays, so the line must carry the version the service announced.

In TS you’d write (pseudocode):

JSON.stringify({ type: 'retire', version: announcedVersion })