Skip to content

Changes

Started by upstream project gerrit-libosmocore #2396
Started 8 hr 9 min ago
Queued 9.6 sec
osmo_io: add osmo_iofd_flush() to transmit the pending Tx queue

osmo_iofd_write_msgb() and friends only enqueue the given message;
the actual transmission happens asynchronously from within
osmo_select_main().  An application that needs to say 'goodbye'
right before calling osmo_iofd_free() (think of a connection
teardown datagram, like TRXC "CMD POWEROFF") currently has no way
to do so reliably: osmo_iofd_free() discards the Tx queue, so a
message enqueued in the same event loop iteration never reaches
the socket.

Add osmo_iofd_flush(), which synchronously transmits the pending
Tx queue, stopping on -EAGAIN or other errors.  Only the poll
backend implements it for now;  the io_uring backend returns
-ENOTSUP, since in-flight SQE submissions make a synchronous
flush non-trivial there.

Change-Id: I4e09e91e472a4441977a2c199c07c2cb8005632f
Vadim Yanitskiy at