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);
}
```
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-netif/+/33193
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I2f52c7107c392b6f4b0bf2a84f8c873c084a200c
Gerrit-Change-Number: 33193
Gerrit-PatchSet: 6
Gerrit-Owner: arehbein <arehbein(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: daniel <dwillmann(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: arehbein <arehbein(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 08 Jun 2023 16:40:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: comment