Re: Reviving gweather
- From: Joe Shaw <joe helixcode com>
- To: Knut Olav B°hmer <knut roal no>
- Cc: gnome-devel-list gnome org
- Subject: Re: Reviving gweather
- Date: Thu, 19 Oct 2000 10:25:45 -0400 (EDT)
> Does gtk or gnome provide anny method for nonblocking i/o like select() or
> poll()? that fex. emits a signal every time there is something to read on
> the socket.
Check out the GIOChannel. It's exactly what you're looking for, and is
provided in glib.
Essentially, you create a GIOChannel by using g_io_channel_unix_new() and
passing it the file descriptor. Then you put a watch on it which calls a
callback. Something like
g_io_add_watch(channel, G_IO_IN, my_read_func, user_data)
is what you'll want. G_IO_IN tells it to call the function whenever there
is data to read on the channel.
] [Thread Prev