On Sat, Aug 21, 2010 at 11:35, Gregory Collins <g...@gregorycollins.net> wrote: > John Millikin <jmilli...@gmail.com> writes: > >> 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. > > "hSetBuffering handle NoBuffering"? > > The implementation as it is is fine IMO.
Disabling buffering doesn't change the behavior -- hGet h 20 still doesn't return until the handle has at least 20 bytes of input available. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe