readVersion static method

int readVersion(
  1. Map<String, dynamic> json
)

Reads the protocol version out of a decoded frame.

A frame without the field comes from a build that predates it, which by definition speaks firstProtocolVersion.

Implementation

static int readVersion(Map<String, dynamic> json) =>
    json['protocolVersion'] as int? ?? firstProtocolVersion;