onData method

  1. @override
void onData(
  1. dynamic data
)
override

Processes the incoming data payload.

Implementation

@override
void onData(data) {
  if (messageHandler != null) {
    messageHandler!.handle(this, data);
  } else {
    var self = this;
    callback(packet, [foo, bar]) {
      if ('close' == packet['type']) {
        self.onClose();
        return false;
      }

      self.onPacket(packet);
      return true;
    }

    PacketParser.decodePayload(data, callback: callback);
  }
}