sendFrame method

Future<void> sendFrame(
  1. StompFrame frame
)

Sends a frame to the client

Implementation

Future<void> sendFrame(StompFrame frame) async {
  if (stream.isClosed) {
    throw const StompConnectionException('Connection is closed');
  }

  final frameBytes = frame.toBytes();
  await stream.write(frameBytes);
  _logger.finest('Sent frame to ${peerId}: ${frame.command}');
}