Re: Infinite Loop with Glib::IO->add_watch()



On Wed, Sep 08, 2004 at 10:51:02 -0700, Mike Schilli wrote:
A. Pagaltzis wrote on 9/8/2004, 1:28 AM:

 > The Glib docs say that 'in' aka G_IO_IN means "There is data to
 > read.", and since you're not reading any data in your callback,
 > after the callback returns, there's still data to be read, and so
 > it gets called again.

Gotcha. One other related question: In the examples, I somewhere found 
the notion

     Gtk2::Helper->add_watch(fileno(READHANDLE), 'in', \&callback);

instead of

     Glib::IO->add_watch(fileno(\*READHANDLE), 'in', \&callback);

Are these equivalent or do you prefer one or the other?

Don't ask others what they prefer. Ask yourself what you prefer.
Operationaly, they are completely equivalent.

-------------------------------------------------------------------------------
                                                 Jan 'Bulb' Hudec <bulb ucw cz>

Attachment: signature.asc
Description: Digital signature



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