[Haskell-cafe] hSetBuffering woes

Eric eeoam at ukfsn.org
Sat Jun 16 11:17:39 EDT 2007


David House wrote:
> Eric writes:
>  > I tried to turn off buffering with the command hSetBuffering (from 
>  > System.IO) but my app still blocks on hGetContents (from 
>  > Data.ByteString). Does anyone know what's happening?
>
> I very much doubt anyone will be able to help you unless you include some code
> for us all to look at.
>
>   
import Network
import System.IO
import Data.ByteString as Bits(ByteString,  hGetContents)

soc <- listenOn $ PortNumber 2007
(hdl, host, port) <- accept soc
hSetBuffering hdl No Buffering;
bs <- Bits.hGetContents hdl;  -- blocks here despite previous line

E.



More information about the Haskell-Cafe mailing list