change condition on io_watch



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
immediately, bogging down the performance of the GUI. The only way I
found, is to g_source_remove() and g_io_add_watch() again each time
which can happen thousands of times right away as well as only once
after hours. Isn't there a possibility to just change the condition?

Thanks for any advice,

-- 
chri



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]