[Haskell] Re: [Haskell-cafe] ANNOUNCE: enumerator, an alternative iteratee package

John Millikin jmillikin at gmail.com
Sat Aug 21 13:58:56 EDT 2010

I think the docs are wrong, or perhaps we're misunderstanding them.
Magnus is correct.

Attached is a test program which listens on two ports, 42000 (blocking
IO) and 42001 (non-blocking). You can use netcat, telnet, etc, to send
it data. The behavior is as Magnus describes: bytes from
hGetNonBlocking are available immediately, while hGet waits for a full
buffer (or EOF) before returning.

This behavior obviously makes hGet unsuitable for enumHandle; my
apologies for not understanding the problem sooner.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nonblocking-io-test.hs
Type: text/x-haskell
Size: 1077 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100821/edf105a9/nonblocking-io-test.bin

More information about the Haskell-Cafe mailing list