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

I've made a modified version of the program that uses GIO functions to
read datas from the server, it also sets the encoding to NULL and
buffering to FALSE

That indeed is very often what one should do, yes.

Additionally, if you make the cbk function a proper GIOFunc by making
it be of type gboolean and return TRUE, and if you add also the
G_IO_HUP condition to the g_io_add_watch() call, your program works.

(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.

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... )


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