parseResponse method

  1. @override
JoinGroupResponse parseResponse(
  1. List<int> bytes
)
override

Implementation

@override
JoinGroupResponse parseResponse(List<int> bytes) {
  final response =
      _matching(JoinGroupResponse.fromBytes(bytes), correlationId);
  if (response.errorCode == 0 &&
      !protocols.any((p) => p.name == response.protocolName)) {
    throw const FormatException('Coordinator selected an unoffered protocol');
  }
  if (response.errorCode == 0 &&
      memberId.isNotEmpty &&
      response.memberId != memberId) {
    throw const FormatException('Coordinator changed an existing member ID');
  }
  return response;
}