Attention is currently required from: jolly, pespin.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/36123?usp=email )
Change subject: stream_cli: Do not try to send msg, if not connected ......................................................................
Patch Set 4: Code-Review+1
(1 comment)
File src/stream_cli.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/36123/comment/e041ae26_cd2e9bc8 PS4, Line 998: if (cli->state != STREAM_CLI_STATE_CONNECTED) {
Is this really a problem? or will the socket enqueue the data and transmit it automatically after co […]
I think with the osmo_fd mode it is indeed just enqueued in our own internal write_queue which might be drained once connect is complete.
However, for osmo_io, there is no in-application/library write_queue. Instead we immediately submit the write into the io_uring submission queue.
It's illegal to do a write on a socket before it is connected.
See https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html:
[ECONNRESET] A write was attempted on a socket that is not connected.