#include <oskit/io/asyncio.h>OSKIT_COMDECL oskit_asyncio_add_listener(oskit_asyncio_t *io, oskit_listener_t *l, oskit_s32_t mask);
Add a callback listener object to handle asynchronous I/O events. When an event of interest occurs on this I/O object (i.e., when one of the one to three I/O conditions becomes true), all registered listeners will be called.The mask parameter is an OR'ed combination of the OSKIT_ASYNCIO flags above. It specifies which events the listener is interested in. Note that spurious notifications are possible, the listener must use oskit_asyncio_poll to determine the actual state of affairs.
Also, if successful, this method returns a mask describing which of the OSKIT_ASYNCIO conditions are already true, which the caller must check in order to avoid missing events that occur just before the listener is registered.
- io
- The async I/O object.
- l
- The oskit_listener object to call.
- mask
- A mask of flags indicating which events are of interest.
If successful, returns a mask of the OSKIT_ASYNCIO currently pending. Otherwise, returns an error code specified in <oskit/error.h>.