Re: status of IO Channels on Windows?
- From: Rick Jones <rick jones2 hp com>
- To: gtk-list gnome org
- Subject: Re: status of IO Channels on Windows?
- Date: Thu, 09 Mar 2006 15:20:05 -0800
Tor Lillqvist wrote:
Rick Jones writes:
> I was wondering about the status of IO Channels under Windows -
> specificially with respect to SOCKETs (the capitalization is
> Windows', not mine :) I ask because:
> Currently full support is available on UNIX platforms, support for
> Windows is only partially complete.
There are some gotchas, but many things work without problems... Is
that vague enough? ;)
Yep. And with the little "learning program" I'm writing under linux,
I've had fun with getting things non-buffered and NULL encoded :) A bit
of a mindwarp for me. Probably good for me, but had me grumbling a
couple times thinking "this isn't a blankety blank socket, it is a FILE
I take it that the deprecated status of g_io_channel_[read|write] is
"for real" and not just to scare people away?
One gotcha is that setting up a watch on a GIOChannel to a socket puts
the socket in non-blocking mode. This doesn't happen on Unix. But
then, if you are using watches, your program presumably should use
non-blocking IO anyway (otherwise, why not just use blocking socket
API calls directly), so this shouldn't be a big deal.
I suspect I can deal with that.
There are also differences in how and when the callbacks are
called. There are some open bugs on this (see for instance #331214)
and things may change a bit (to make the behaviour more like on Unix)
soon. Anyway, your best bet is to write your code so that when you get
a callback for G_IO_IN, you keep looping reading as much as you can
get until you get the G_IO_STATUS_AGAIN indication.
(BTW, see http://www.iki.fi/tml/fosdem-2006.pdf for some hints.)
So, has it been compiled P64 yet?-) Don't yo just love how 64-bit
windows went P64 rather than LP64 ?-)
] [Thread Prev