
4 Dec
2008
4 Dec
'08
6:54 p.m.
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.