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

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?

-- Mike
Mike Schilli
m perlmeister com

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