Differences of GIOChannel between Linux and win32



I have a question about the cross-platform compatibility of
GIOChannels, between win32 (using mingw32) and Linux, when using
pipes. I am using g_spawn_async_with_pipes to spawn a series of
programs that do some processing and deliver results. Specifically,
I'm using the Generic Mapping Tools (GMT).

My initial development on Linux worked well, I set up a single
callback with an event mask of G_IO_IN | G_IO_HUP, and when I got
IO_IN, I'd read data in from the stdout pipe. When I got a HUP, I'd
know the program is done, and move on to the next program that I need
to call.

Under Win32, I don't seem to get the HUP with this approach. I had
heard anecdotal stories that the win32 implementation of IOChannels
doesn't let you combine events in the event mask, so I split the
callbacks into two functions. This time it worked, but I'd randomly
get cases where the HUP event is generated *before* all the data is
read in through the channel. I finally got it to work by not using the
HUP event at all, but checking to see if I get an error when reading
the IO Channel (g_io_channel_get_chars would return G_IO_STATUS_EOF).
This works on win32, but not Linux, the program would never see an eof

My question is: is there some documentation on what part of GIOChannel
is broken on win32 and what's not?

-Jim



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