On Wed, Aug 16, 2006 at 06:24:37AM -0700, Justin Erenkrantz wrote: > Back to our original question: how can we portably detect that the socket is > still alive? We can't do a non-blocking read() either... -- justin
AFAIK the closure of the read direction of the socket is exposed only by consuming the receive buffer until a read returns EOF. There is no way to determine "is the next thing available to read going to be EOF" except by actually doing the read/recv. (I guess recv/MSG_PEEK will tell you without having to actually consume the EOF; not sure that makes any difference though) joe
