Re: Detecting shutdown of remote socket endpoint.

2005-01-12 Thread Michael Hobbs
Tim Gosselin <[EMAIL PROTECTED]> wrote: > I am writing a tcp tunnel but cannot find a way of detecting when a socket > shuts down its read end without writing to the socket. For testing the > write end of the remote endpoint I just do a: > > if not sock.recv(buffsize) > > I cannot write to the so

Detecting shutdown of remote socket endpoint.

2005-01-11 Thread Tim Gosselin
I am writing a tcp tunnel but cannot find a way of detecting when a socket shuts down its read end without writing to the socket. For testing the write end of the remote endpoint I just do a: if not sock.recv(buffsize) I cannot write to the socket and check if send returns 0 though, because that