apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jagunet.com>
Subject Re: APR leaves port bound when terminated?
Date Wed, 22 Feb 2006 17:02:21 GMT
Sorry if this wasn't clear: the reason that SO_REUSEADDR
exists (and it's APR cousin) is to remove this
problem, and allow for the tcp/ip stack to
reuse it. So the fact that you're seeing this
is likely due to that option isn't being sent.

I believe the patch is to adjust
TCN_IMPLEMENT_CALL(jint, Socket, bind) in network.c
and add apr_socket_opt_set(s->sock, APR_SO_REUSEADDR, 1)
right before the apr_socket_bind call...

On Feb 21, 2006, at 7:05 PM, Sean Neeley wrote:

> I would be happy to test a version of APR with different socket  
> options.
> Thanks.
> - Sean
> -----Original Message-----
> From: rooneg@gmail.com [mailto:rooneg@gmail.com] On Behalf Of Garrett
> Rooney
> Sent: Tuesday, February 21, 2006 5:54 PM
> To: jim@jagunet.com
> Cc: Sean Neeley; dev@apr.apache.org
> Subject: Re: APR leaves port bound when terminated?
> On 2/21/06, Jim Jagielski <jim@jagunet.com> wrote:
>> I would guess this in an artifact of SO_REUSEADDR
> Actually, wouldn't setting SO_REUSEADDR (or APR_SO_REUSEADDR in this
> case) make the problem go away?  I'd assumed that the code in Tomcat
> just wasn't doing that or something.
> -garrett

View raw message