Re: GIO channels and "connection closed by foreign host" on WIN32



On Tue, Mar 17, 2009 at 6:59 PM, Tor Lillqvist <tml iki fi> wrote:
(Yes, it might well be that it should be considerd a bug that one on
Windows has to explicitly watch for G_IO_HUP in addition to G_IO_IN to
be able to catch EOF. Please file a bug for that.

This change made the trick:

g_io_add_watch(ch, (GIOCondition) G_IO_IN|G_IO_HUP, cbk, NULL);


I filed a bug about this behaviour, 575806, I just replied here to
tell that with G_IO_HUP in the callback also the classic logic

if recv(fd) == 0 then IS DISCONNECT

works.

The exact intended semantics of the GIOChannel API isn' clearly
specified IMHO, and even if it was, one can say that it is more
important that code that de facto does work on Unix should also work
on Windows, even if strictly speaking the code would not need to work
even on Unix according to specs... )

Why? The only real problem was the fact the cbk was void.

GIOChannel API give the user a g_io_channel_unix_get_fd() call, so I
suppose it should be supported handling the channel yourself. This is
a very important feature since there are a few network toolkit that
can be made interoperable with GTK through this feature.

-- 
Bye,
 Gabry



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