handleLinkModeMessage method

  1. @override
Future<bool> handleLinkModeMessage(
  1. String topic,
  2. String message
)
override

Implementation

@override
Future<bool> handleLinkModeMessage(String topic, String message) async {
  core.logger.d('[$runtimeType]: handleLinkModeMessage: $topic, $message');

  // if client calls dispatchEnvelope with the same message more than once we do nothing.
  final recorded = messageTracker.messageIsRecorded(topic, message);
  if (recorded) return true;

  // Broadcast the message
  onLinkModeMessage.broadcast(
    MessageEvent(
      topic,
      message,
      DateTime.now().millisecondsSinceEpoch,
      TransportType.linkMode,
    ),
  );
  return true;
}