From 3ff2ca837a074d3b4a82337b4a2107514cbcc390 Mon Sep 17 00:00:00 2001 From: Michal Bloch Date: Thu, 27 Jan 2022 18:32:22 +0100 Subject: [PATCH] libdbus-p2p: fix messages sometimes not being sent Change-Id: I989a600a7f664215545e4e3187448f431c4d10a2 Signed-off-by: Michal Bloch --- benchmark/libdbus-p2p-client.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/benchmark/libdbus-p2p-client.cpp b/benchmark/libdbus-p2p-client.cpp index 9788265..319b4e5 100644 --- a/benchmark/libdbus-p2p-client.cpp +++ b/benchmark/libdbus-p2p-client.cpp @@ -151,6 +151,12 @@ int main (int argc, char ** argv) dbus_connection_send (conn, msg, nullptr); dbus_message_unref (msg); + /* `send` is only required to add a message to the queue. + * It will usually flush the queue once messages start + * piling up, but we don't want any to linger around until + * then since that counts against their latency. */ + dbus_connection_flush (conn); + std::this_thread::sleep_for (opt.delay); } -- 2.34.1