send method
Implementation
Future<void> send(String type, Uint8List data, {int? id}) async {
if (_sendError != null) {
throw _sendError!;
}
final msg = ProtocolMessage(id: id ?? getNextMessageId(), type: type, data: data);
_send.add(msg);
await msg.sent.future;
}