onData method

  1. @override
void onData(
  1. Datagram packet
)
inherited

Override this function to process incoming data, along with the source address and port.

Implementation

@override
void onData(Datagram packet) {
  final wrapper = WrappedMessage.fromBuffer(packet.data);
  final source = SocketInfo(address: packet.address, port: packet.port);
  onWrapper(wrapper, source);
}