Re: GIOChannel and pipes.



Claudio Saavedra V. wrote:
Hi all

I'm trying to write an GTK/GNOME application that uses pipes, and i want to use
GIOChannel for it, but i have no other documentation than the API, and i can't
find examples or codes in the net about it.

What else can really be said about io channels than what is in
the API reference ? The description section is quite elaborite.

I usualy use them for any IO I have to wake up on (i.e. sockets,
device file desctiptors, named pipes or simple full duplex pipes
used between parent/child processes).

Just aquire your file descriptor, create a channel from that, use
g_io_add_watch() (which returns a `source ID' that can be removed
later on with g_source_remove) and voila ! you've integrated
a callback for IO on that file descriptor into the main loop, magic.

Cheers,
                                    -Tristan




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