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