Hi,
actually I did not use the perl EV::Glib binding, but had a look to
check how to embed a glib main loop into libev using the EV::Glib code
as an example as pointed out in the documentation.
I got the idea, copied major parts of the EV::Glib code, and it did not
work.
Tracking the problem, it turned out the EV::Glib code is buggy and can't
work if used to poll for G_IO_OUT.
In check_cb (EV_P_ ev_check *w, int revents)
...
pfd->revents |= pfd->events &
((revents & EV_READ ? G_IO_IN : 0)
| (revents & EV_READ ? G_IO_OUT : 0));
...
it's got to be:
...
pfd->revents |= pfd->events &
((revents & EV_READ ? G_IO_IN : 0)
| (revents & EV_WRITE ? G_IO_OUT : 0));
...
According to CVS, this was broken for 13 months now, starting with
Glib.xs revision 1.1.
I had a look on Glib::EV too, and the same problem exists there too.
In io_cb (EV_P_ ev_io *w, int revents)
.......
s->pfd->revents |= s->pfd->events &
((revents & EV_READ ? G_IO_IN : 0)
| (revents & EV_READ ? G_IO_OUT : 0));
.......
MfG
Markus
_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev