Re: Network/Notwork?

- using hFlush does *not* seem to cure the problem??
That's worrying, and it perhaps indicates that there's another problem somewhere. I just tried a small test and hFlush does appear to do the right thing, so do you think you could boil down your example to something small that demonstrates the problem? Does it happen only on Windows, or Un*x too?
Windows only, of course!-) On Solaris, I never even noticed there
might be a problem (it seems to work even without acknowledgment or
hFlush..).
I append my current test MyNetwork module - server and client are
the main functions of the respective apps, nothing else going on, so
it's very small, but for modified copies of some of the Network code
(for use on windows, you'll want to change to the other definition
of whatsWrong and uncomment c_getLastError).
On solaris (ghc version 5.04), this seems to work as shown. On win2k
(ghc version 5.04), with error reporting on, I get:
$ ./server.exe &
[1] 1388
tcp: 6
$ ./client.exe huhuadsfas
tcp: 6
CLIENT: huhuadsfas
WSAGetLastError: 10054
Fail: failed
Action: hGetLine
Handle: {loc=

Hi, 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? /Peter

The problem is that the necessary header file (config.h) isn't included
in that module. This was fixed a while ago in HEAD.
--sigbjorn
----- Original Message -----
From: "Peter Strand"
Hi,
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?
participants (3)
-
C.Reinke
-
Peter Strand
-
Sigbjorn Finne