Next: External I/O Loop Server, Up: External I/O Loop [Contents][Index]
The reference implementation for using external I/O event loops in the client is the GPGME library, which exports its own external I/O event loop mechanism and utilizes the Assuan library transparently for the user. The following steps document how GPGME achieves this.
assuan_socket_connect
which takes an
already connected socket FD and turns it into an Assuan context), so
if you need this let us know.
assuan_get_active_fds
(the first one returned is the status
FD). This FD can be duplicated if it is convenient (GPGME does this
to be able to close this FD and associated callback handlers without
disrupting Assuan’s internals).
assuan_release
.
INQUIRE
function can be handled in two ways: If the
requested data is immediately available, the client can just send the
data blockingly. If the requested data needs to be fetched from a
blocking source, a callback handler can be registered for the FD with
the main event loop. GPGME does not support the INQUIRE
function, so we do not have any practical experience with this.
Currently, the client can not cancel a pending operation gracefully. It can, however, disconnect from the server at any time. It is the responsibility of the server to periodically send status messages to the client to probe if the connection remains alive.
Next: External I/O Loop Server, Up: External I/O Loop [Contents][Index]