apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: [Fwd: Re: How to detect is the socket is still open]
Date Wed, 16 Aug 2006 14:25:56 GMT
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)


View raw message