removeMessageCallback method

  1. @override
bool removeMessageCallback(
  1. PeerInfo peer,
  2. MessageCallbackFunction cb
)

Removes a message callback associated with a specific remote endpoint Returns true if a callback was removed, false if no callback was found

Implementation

@override
bool removeMessageCallback(PeerInfo peer, MessageCallbackFunction cb) {
  final key =
          MessageCallbackMap.formatKey(peer.address, peer.port);
  if (_messageCallbacks.containsKey(key)) {
    _messageCallbacks.removeCallback(key, cb);
    return true;
  }
  return false;
}