[Haskell-cafe] Simple binary-protocol through network test

Daniel Fischer daniel.is.fischer at web.de
Thu Apr 8 09:04:54 EDT 2010

Am Donnerstag 08 April 2010 09:17:04 schrieb Yves Parès:
> Problem tracked!
> It comes from the last version of bytestring package.

Alas, it's maybe not so simple.

> I tried with bytestring-, and it works perfectly.

I just tried with bytestring- and it worked perfectly for sending 
and receiving operations.
For the simpler client which just encodes (3,4,5) and sends it to the 
server, however, the server does nothing until the client exits (then it 
prints and exits), I suppose that's what you encountered.

So the change from

hGetContentsN :: Int -> Handle -> IO ByteString
hGetContentsN k h = lazyRead -- TODO close on exceptions
    lazyRead = unsafeInterleaveIO loop

    loop = do
        c <- S.hGetNonBlocking h k


    loop = do
        c <- S.hGet h k

seems to be the cause, but for me it doesn't break the first example.

> Do you know where I should submit this bug?

Maintainer: dons at galois.com, duncan at haskell.org

> -----
> Yves Parès
> Live long and prosper

More information about the Haskell-Cafe mailing list