Socket library ghc 5.02.1

Volker Stolz stolz@hyperion.informatik.rwth-aachen.de
Thu, 22 Nov 2001 14:43:48 +0100


In local.glasgow-haskell-users, you wrote:
>> main =
>>     do
>>     d <- connectTo "localhost" (PortNumber 80)
>>     hPutStr d "GET / HTTP/1.0\n\n"
>>     hFlush d
>>     c <- hGetContents d
>>     putStr c
>
> whereas on Linux I get the following error:
> *** Exception: failed
> Action: connect
> Reason: Unknown error 142731264

Please run the program with 'strace', e.g.
strace -o log ./a.out
and post the log when it fails.

Be aware that 'hGetContents' is broken on 5.02.1 if you use it
extensively (the GC will close already-reused fds and cause
your program to crash!), the patch was recently postet to -bugs
by Simon Marlow and works. OTOH, this is not the bug you're seeing.
-- 
Volker Stolz * stolz@i2.informatik.rwth-aachen.de * PGP + S/MIME