[Haskell-cafe] Simple network client

Timo B. Hübel t.h at gmx.info
Tue Jan 29 11:32:53 EST 2008


On Tuesday 29 January 2008 17:12:19 you wrote:
> There was a similar bug in lazy bytestring's hGetContents a while back
> which involve it waiting for a whole chunk and not returning short
> reads, but from watching the strace of this code, GHC is reading
> byte-by-byte (which is actually pretty dumb, but functions).

I have to apologize, I probably got something wrong when trying the solution 
from Mads. I did it again now and now it seems to work (apart from the client 
still waiting for more data instead of exiting, but thats probably due to the 
way the data is read).

I actually want to transmit ByteStrings in exactly this way (one request to 
the server, the server does some processing and sends a response back), but 
couldn't get it to work and therefore tried with ordinary strings. Now I can 
move forward to ByteStrings.

Thanks!
Timo


More information about the Haskell-Cafe mailing list