+/** @brief Called when a NOP completes */
+static void nop_completed(void attribute((unused)) *v) {
+ nop_in_flight = 0;
+}
+
+/** @brief Called from time to time to arrange for a NOP to be sent
+ *
+ * At most one NOP remains in flight at any moment. If the client is not
+ * currently connected then no NOP is sent.
+ */
+static gboolean maybe_send_nop(gpointer attribute((unused)) data) {
+ if(!nop_in_flight && disorder_eclient_connected(client)) {
+ nop_in_flight = 1;
+ disorder_eclient_nop(client, nop_completed, 0);
+ }
+ return TRUE; /* keep call me please */
+}
+