Re: Fast I/O with sockets

2003-09-17 Thread Peter Simons
Simon Marlow writes: hGetLine should work fine, indeed that's what I used in the Haskell Web Server. Well, another -- and more important -- problem with hGetLine is that it will read an arbitrarily long line. An attacker might use this to implement an denial-of-service attack simply by

RE: Fast I/O with sockets

2003-09-16 Thread Simon Marlow
I was wondering how to read and write from a Socket in the most performant way. According to the library documentation from GHC, 'hGetBuf' and 'hPutBuf' are the way to go. But my problem with these functions is that they expect to read exactly the number of bytes I gave them! The IO