onMessage method

void onMessage(
  1. I data, [
  2. Channel channel = kAnyChannel
])

Implementation

void onMessage(I data, [Channel channel = kAnyChannel]) {
  final result = decodeChannel(data, channel);
  if (result == null) return;
  final (rawData, rawChannel) = result;
  _readController.add(NetworkerPacket(rawData, rawChannel));
  for (final plugin in _pipes.keys) {
    try {
      plugin.onMessage(rawData, rawChannel);
    } catch (_) {}
  }
}