Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-20 Thread Mladen Turk
Ruediger Pluem wrote: Reposting what I sent to Mladen in private. Just missed that his address was in to and not dev@apr.apache.org :-) OK. Here is the new code used in mod_jk It works for the selected set of platforms (windows, linux, solaris) Any comments about other platforms? int

Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-16 Thread Justin Erenkrantz
On 8/3/06, Gonzalo Paniagua Javier [EMAIL PROTECTED] wrote: It reports that the socket is readable. And when you read it, it returns EOF? Yes, it returns a 0. Are you on Mac OS X by any chance? I'm seeing this same thing with serf via apr_pollset_poll(). select() returns 5 (POLLIN

Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-16 Thread Joe Orton
On Wed, Aug 16, 2006 at 12:01:34AM -0700, Justin Erenkrantz wrote: On that second update, there are often 15+ second pauses from svn.a.o that causes httpd to close the connection as its idle. But, when we want to reuse that connection later, serf does a pollset_poll() and it says that the

Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-16 Thread Alexander Lazic
On Mit 16.08.2006 08:55, Joe Orton wrote: POLLERR would only be set for an RST and exceptional conditions; the same applies to select()+the exceptfds array AFAIK. There is some inconsistency with handling FIN and sockets across platforms: http://www.greenend.org.uk/rjk/2001/06/poll.html but

Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-16 Thread Justin Erenkrantz
On Wed, Aug 16, 2006 at 08:55:44AM +0100, Joe Orton wrote: POLLERR would only be set for an RST and exceptional conditions; the same applies to select()+the exceptfds array AFAIK. There is some inconsistency with handling FIN and sockets across platforms:

Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-16 Thread Davi Arnaut
Em 16/08/2006, às 10:24, Justin Erenkrantz escreveu: On Wed, Aug 16, 2006 at 08:55:44AM +0100, Joe Orton wrote: POLLERR would only be set for an RST and exceptional conditions; the same applies to select()+the exceptfds array AFAIK. There is some inconsistency with handling FIN and sockets

Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-16 Thread Justin Erenkrantz
On 8/16/06, Davi Arnaut [EMAIL PROTECTED] wrote: The only portable way to detect a broken connection is using SO_KEEPALIVE or to write/read ping data through the socket -- which is what keepalive does. How would SO_KEEPALIVE help? The other end is deliberately closing the connection and we

Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-16 Thread Joe Orton
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

Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-16 Thread Davi Arnaut
Em 16/08/2006, às 11:00, Justin Erenkrantz escreveu: On 8/16/06, Davi Arnaut [EMAIL PROTECTED] wrote: The only portable way to detect a broken connection is using SO_KEEPALIVE or to write/read ping data through the socket -- which is what keepalive does. How would SO_KEEPALIVE help? The

Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-16 Thread Joe Orton
On Wed, Aug 16, 2006 at 12:36:23PM -0300, Davi Arnaut wrote: Em 16/08/2006, às 11:00, Justin Erenkrantz escreveu: Would a non-blocking read() followed by a poll()/select() be useful? We'd still get a 0 back from read() - but if it was the EOF, would the state of the socket change to be in the

Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-16 Thread Davi Arnaut
Em 16/08/2006, às 12:49, Joe Orton escreveu: On Wed, Aug 16, 2006 at 12:36:23PM -0300, Davi Arnaut wrote: Em 16/08/2006, às 11:00, Justin Erenkrantz escreveu: Would a non-blocking read() followed by a poll()/select() be useful? We'd still get a 0 back from read() - but if it was the EOF,

Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-16 Thread Davi Arnaut
Em 16/08/2006, às 14:21, Davi Arnaut escreveu: Em 16/08/2006, às 12:49, Joe Orton escreveu: On Wed, Aug 16, 2006 at 12:36:23PM -0300, Davi Arnaut wrote: Em 16/08/2006, às 11:00, Justin Erenkrantz escreveu: Would a non-blocking read() followed by a poll()/select() be useful? We'd still

Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-03 Thread Ruediger Pluem
On 08/03/2006 02:47 AM, Gonzalo Paniagua Javier wrote: What does poll (with timeout zero) return in the case that the socket has been closed? It reports that the socket is readable. And when you read it, it returns EOF? Regards Rüdiger

Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-03 Thread Gonzalo Paniagua Javier
On 8/3/06, Ruediger Pluem [EMAIL PROTECTED] wrote: On 08/03/2006 02:47 AM, Gonzalo Paniagua Javier wrote: What does poll (with timeout zero) return in the case that the socket has been closed? It reports that the socket is readable. And when you read it, it returns EOF? Yes, it

[Fwd: Re: How to detect is the socket is still open]

2006-08-02 Thread Ruediger Pluem
Reposting what I sent to Mladen in private. Just missed that his address was in to and not dev@apr.apache.org :-) Original Message Subject: Re: How to detect is the socket is still open Date: Wed, 02 Aug 2006 21:57:36 +0200 From: Ruediger Pluem [EMAIL PROTECTED] To: Mladen Turk

Re: [Fwd: Re: How to detect is the socket is still open]

2006-08-02 Thread Gonzalo Paniagua Javier
What does poll (with timeout zero) return in the case that the socket has been closed? It reports that the socket is readable. -Gonzalo