Re: change condition on io_watch
- From: Olivier Sessink <lists olivier pk wau nl>
- To: Christoph Simon <ml133 netpole com br>, GTK+ App Develoment List <gtk-app-devel-list gnome org>
- Cc:
- Subject: Re: change condition on io_watch
- Date: Fri, 02 Dec 2005 18:42:18 +0100
Christoph Simon wrote:
Hi,
I'm trying to write a gtk+ program which is chatting with a server
while allowing the user to do other things. Initially I'm using
g_io_add_watch() which works fine while waiting for read and write
events. The problem is, that the server is always write-ready, thus,
even if I don't want to write anything yet, the callback is executed
if you do not want to write anything you should not watch if the channel
is ready for write.
A better solution would be to watch for read events only, and when you
want to write something change the watch to read+write, and when all
data is written, change it back again to watch only for read events.
regards,
Olivier
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]