Peter Strand
Mon, 17 Mar 2003 22:34:58 +0100


On Mon, Mar 17, 2003 at 07:01:20PM +0000, C.Reinke wrote:
> Windows only, of course!-) On Solaris, I never even noticed there
> might be a problem (it seems to work even without acknowledgment or
> hFlush..).

One explanation could be that hClose ends up calling close instead 
of closesocket under windows. 

I tried your example, and got the same error (under win2k).
But by using a slightly modified hClose, everything seemed to
work well.

In base/GHC/Handle.hs there is a preprocessor conditional on
mingw32_TARGET_OS which seems to be undefined in the distributed
compilation (I used 5.04.3). By explicitly calling closeFd there
instead of c_close it works for me.
Perhaps it should trigger on WITH_WINSOCK instead?