Re: gtk_input_add (posted earlier with wrong subject)


Do you have any suggestions on how i should implement this?

An example would be great.

- Johan

On Thu, 2002-04-04 at 17:03, Bhaskar S. Manda wrote:
Hi there,

I have tried to ways to use input_add.
1. Open a file for read and send in the filehandle to input_add.
   Here i never gets any calls to my function at all.
2. open a file and use fileno( filehandle ) as an input to input_add.
   Here the callback gets called all the time without any new data in
the file to read.
Anybody who understand how to use input_add on a ordinary filhandle?
Please give me an short example.

I've used input_add to 1) read from a pipe that is 'tail -f <somefile>' and 2)
read from an IO::Socket::INET. In both cases, the filehandle that input_add
listens to has something new to read at different points in time, that is, if
that handle is in an IO::Select, it becomes ready to read from. I'm not sure
that such a state change is occurring in the file handles your input_add is

Let's assume for a moment that there is such a change, then I believe
input_add is using a select() somewhere in its implementation, so you can't
use the angle operators <>, you have to use sysread() in your input handler to
read from the file handle. I've run into the kinds of error conditions you
described when using <> on handles which are already in select().


gtk-perl-list mailing list
gtk-perl-list gnome org

Johan Ankarloo
Volvo IT
Network & Security Engineer
Tel: +46 31 32 128 18

This message may contain confidential and/or proprietary information,
and is intended only for the person/entity to whom it was originally
addressed. The content of this message may contain private views and
opinions which do not constitute a formal disclosure or commitment
unless specifically stated.

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