Attention is currently required from: arehbein, laforge, pespin.
daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/33193 )
Change subject: Add osmo_io support to osmo_stream_cli and osmo_stream_srv ......................................................................
Patch Set 6:
(1 comment)
Patchset:
PS5:
The problem I see is: How would you handle compatibility with old code that registers a read_cb? T […]
Some more open questions:
Since we already have osmo_stream_*_get_ofd() we should add osmo_stream_*_get_iofd(). Since they will return pointer we could simply return NULL if it's called with the wrong mode, but maybe an assert is better.
osmo_stream_srv_create2 is called with the newly accept()ed fd so I'd still pass the read/close callbacks in create2(). Otherwise the code would look like this:
``` accept_cb(link, fd) { srv = osmo_stream_srv_create2(ctx, "Connection", link, fd); osmo_stream_srv_set_read_cb(srv, read_cb); osmo_stream_srv_set_close_cb(srv, close_cb);
// Somehow we need to signal that the callbacks are set and we are ready to read data osmo_stream_srv_open(srv); } ```