search for: poll_regist

Displaying 3 results from an estimated 3 matches for "poll_regist".

2019 Jul 15
0
[PATCH libnbd] examples: Include an example of integrating with the glib main loop.
...*/ +struct NBDSource { + /* The base type. This MUST be the first element in this struct. */ + GSource source; + + /* The underlying libnbd handle. */ + struct nbd_handle *nbd; + bool debug; /* true if handle has debug set */ + + /* The poll file descriptor, only valid when poll_registered == true. */ + bool poll_registered; + GPollFD pollfd; + + /* You can optionally register callbacks to be called when the + * handle changes state: + * + * connecting_callback is called once when the handle moves from + * created to connecting state. + * + * connected_callback is...
2019 Jul 15
2
[PATCH libnbd] examples: Include an example of integrating with the glibc main loop.
** NOT WORKING ** This patch shows how to integrate libnbd and the glib main loop. Posted mainly as a point of discussion as it doesn't quite work yet. Rich.
2019 Jul 17
1
Re: [PATCH libnbd] examples: Include an example of integrating with the glib main loop.
...> +{ > + struct NBDSource *source = (struct NBDSource *) sp; > + > + /* When the NBD handle moves out of the created state (which means > + * that it first has a socket associated with it) we must initialize > + * and register the pollfd. > + */ > + if (!source->poll_registered && !nbd_aio_is_created (source->nbd)) { > + int fd; > + > + if (source->connecting_callback) { > + DEBUG (source, "calling connecting_callback"); > + source->connecting_callback (source); > + } If I understand nbd_aio_connect_tcp...