Peter Robinson <[EMAIL PROTECTED]> writes:

> I am writing a server application (using glib) in which I want to be 
> able to (frequently) turn polling on and off for given sockets.

You may want to take a look at this:

http://www.daimi.au.dk/~sandmann/watch.h
http://www.daimi.au.dk/~sandmann/watch.c

It allows you to watch arbitrary pollable file descriptors by just
setting a callback. To turn off polling, you just set the callback to
NULL. Ie.,

To watch a descriptor:

        fd_add_watch (fd, data);

To turn polling on:

        fd_set_read_callback (fd, callback);

to turn polling off:

        fd_set_read_callback (fd, NULL);

I have found it to be a more convenient API than the g_io_ stuff in
glib.


Soren
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to