Quoth Evan Laforge <qdun...@gmail.com>,

> sleep = Process.createProcess (Process.proc "sleep" ["5"])

 sleep = Process.createProcess
        ((Process.proc "sleep" ["5"]) {Process.close_fds = True})


- Because the client uses buffered I/O (hGetContents in this case, but
hGet-anything would be the same), it doesn't "see" the server response
until a) buffer full, or b) end of file (server closes connection.)

- The server does close the connection, but after the "sleep" process
has forked off with a copy of the connection fd.  If it doesn't close
that fd explicitly, it holds it open until process exit (5 seconds.)

        Donn

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to