removeHandler method
Implementation
void removeHandler(String type, ProtocolMessageHandler handler) {
final current = handlers[type];
if (!identical(current, handler)) {
throw StateError('handler mismatch for $type');
}
handlers.remove(type);
}