Tim Docker wrote:
One way of doing this would would be to maintain a separate thread that
is always reading from the client, and buffers until the main thread
needs the information. Whilst this would detect the remote close, it
also would potentially consume large amounts of memory to maintain this
buffer.

I think flushing a lost connection causes an error. So instead of buffering its incoming data, you could try flushing the handle and see if that causes an error, which you can then catch.

No idea if that will work, but it's worth a try.

Martijn.

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

Reply via email to