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

John Millikin jmillikin at gmail.com
Sat Aug 21 15:18:18 EDT 2010


On Sat, Aug 21, 2010 at 11:35, Gregory Collins <greg at gregorycollins.net> wrote:
> John Millikin <jmillikin at 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.


More information about the Haskell-Cafe mailing list