Re: [Haskell-cafe] hSetBuffering woes

2007-06-19 Thread Eric
Bryan O'Sullivan wrote: Eric wrote: I'm writing a simple HTTP server and am trying to implement the POST method. That's a rather general problem statement, indeed :-) For an application like this, I'd suggest that explicit resource management is the way to go, and that you should not be

Re: [Haskell-cafe] hSetBuffering woes

2007-06-19 Thread Donald Bruce Stewart
eeoam: Bryan O'Sullivan wrote: Eric wrote: I'm writing a simple HTTP server and am trying to implement the POST method. That's a rather general problem statement, indeed :-) For an application like this, I'd suggest that explicit resource management is the way to go, and that you

Re: [Haskell-cafe] hSetBuffering woes

2007-06-17 Thread Bryan O'Sullivan
Eric wrote: I'm writing a simple HTTP server and am trying to implement the POST method. That's a rather general problem statement, indeed :-) For an application like this, I'd suggest that explicit resource management is the way to go, and that you should not be using hGetContents at

[Haskell-cafe] hSetBuffering woes

2007-06-16 Thread Eric
Hi all, 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? E. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] hSetBuffering woes

2007-06-16 Thread David House
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

Re: [Haskell-cafe] hSetBuffering woes

2007-06-16 Thread Eric
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

Re: [Haskell-cafe] hSetBuffering woes

2007-06-16 Thread Tomasz Zielonka
On Sat, Jun 16, 2007 at 04:17:39PM +0100, Eric wrote: 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

Re: [Haskell-cafe] hSetBuffering woes

2007-06-16 Thread Bryan O'Sullivan
Eric wrote: 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? The hGetContents function can't behave the way you want, because it's defined to return the entire

Re: [Haskell-cafe] hSetBuffering woes

2007-06-16 Thread Eric
Bryan O'Sullivan wrote: Eric wrote: 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? The hGetContents function can't behave the way you want, because it's defined

Re: [Haskell-cafe] hSetBuffering woes

2007-06-16 Thread Bryan O'Sullivan
Eric wrote: I've converted to lazy bytestrings. After reading in the bytes from a network connection I want to save them to a file but now the appendFile function blocks: Well, yes. It's presumably waiting for data from the network connection, because it wants to write out the entire

Re: [Haskell-cafe] hSetBuffering woes

2007-06-16 Thread Eric
Bryan O'Sullivan wrote: Eric wrote: I've converted to lazy bytestrings. After reading in the bytes from a network connection I want to save them to a file but now the appendFile function blocks: Well, yes. It's presumably waiting for data from the network connection, because it wants to