send method

  1. @override
Future<void> send(
  1. Object? data
)
override

Implementation

@override
Future<void> send(Object? data) {
  if (_connectionState != ConnectionState.Connected) {
    return Future.error(GeneralError(
        "Cannot send data if the connection is not in the 'Connected' State."));
  }

  if (_sendQueue == null) {
    _sendQueue = new TransportSendQueue(_transport);
  }

  // Transport will not be null if state is connected
  return _sendQueue!.send(data);
}