sendBinary method
Implementation
Future<void> sendBinary(Uint8List binary) async {
if (!open) {
logger.error(
"Connection is not open. You should listen for the `open` event before sending messages.",
);
super.emit(
"error",
Exception(
"Connection is not open. You should listen for the `open` event before sending messages.",
),
);
return;
}
final message = RTCDataChannelMessage.fromBinary(binary);
await dataChannel?.send(message);
}