[ENet-discuss] Using enet in X11 event loop

Darrin Smart darrinsmart at gmail.com
Tue Sep 4 02:49:36 PDT 2007


Hi,

Has anyone managed to integrate enet into a X11 (Xt) event loop? We
are currently calling enet_service() from a timer but I would like to
be able to use the XtAppAddInput() function to create callbacks when
the enet socket is ready for reading or writing.

The reading side is straightforward - when there is data available on
the socket I get a callback and I can run enet_service().

But on the sending side its not so straightforward. I really only want
the Xt callback to be active only when enet has data queued for
sending. That leaves quite a few places where I need to activate the
Xt callback.

Is there a better way? Maybe the enet API could include hooks so the
user can specify the enable/disable function for output, which the
library could call from the right internal functions.

Thanks.

Darrin


More information about the ENet-discuss mailing list