negotiate static method
The highest version from clientVersions this library supports.
Implementation
static int negotiate(List<int> clientVersions) {
final overlap = clientVersions
.where(supportedWireVersions.contains)
.toList();
if (overlap.isEmpty) {
throw WireVersionError(
'no protocol version overlap: client offers $clientVersions, '
'server supports ${supportedWireVersions.toList()..sort()}',
);
}
overlap.sort();
return overlap.last;
}