getCurrentProtocolVersion method

Future<int> getCurrentProtocolVersion()
inherited

Returns our Ouisync protocol version.

In order to establish connections with peers, they must use the same protocol version as us.

See also Self::session_get_highest_seen_protocol_version

Implementation

Future<int> getCurrentProtocolVersion(
) async {
  final request = RequestSessionGetCurrentProtocolVersion(
  );
  final response = await client.invoke(request);
  switch (response) {
    case ResponseU64(value: final value): return value;
    default: throw UnexpectedResponse();
  }
}