negotiateVersion static method

int? negotiateVersion(
  1. List<int> clientVersions
)

Finds the highest common version between client and server

Implementation

static int? negotiateVersion(List<int> clientVersions) {
  for (final version in supportedVersions) {
    if (clientVersions.contains(version)) {
      return version;
    }
  }
  return null;
}