dev@glassfish.java.net

Re: [FYI] More frequent BindException to occur

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Tue, 26 Jan 2010 18:51:16 +0100

Hi Bill,

this is the issue we have filed [1].
Currently in GFv3 we use OS default reuseAddress value for Sockets.

The issue is still marked as open, because there is some problem with
embedded mode, but I guess it should be the same for both standalone
and embedded.
I'll will ask NIO team for their opinion on this.

WBR,
Alexey.

https://glassfish.dev.java.net/issues/show_bug.cgi?id=10690


On Jan 25, 2010, at 21:08 , Bill Shannon wrote:

> Does anyone know whether and how this issue was resolved?
>
> Jeanfrancois Arcand wrote on 10/30/09 12:27 PM:
>> Le 2009-10-30 à 14:39, Bill Shannon <Bill.Shannon_at_Sun.COM> a écrit :
>>> This issue came up a week or two ago in a bug report.
>>> I looked into it enough to determine that it's incredibly
>>> ugly and Windows is just broken.
>>>
>>> As I remember...
>>>
>>> After closing a socket, the socket can be left in a "timed wait"
>>> state for some time after the program has exited. Unless you use
>>> the "reuse address" flag, a program can't bind to the socket even
>>> though no other program is using the socket.
>>>
>>> On Unix, "reuse address" allows you to bind to sockets that are in
>>> this state. It doesn't allow you to bind to sockets that are
>>> actively open and in use by another program.
>>>
>>> On Windows, "reuse address" allows you to bind to the socket even
>>> though another program is actively using the socket.
>>>
>>> I never figured out if there was a way to get the Unix behavior on
>>> Windows. There might be at the C level, but probably not at the
>>> Java level.
>>>
>>> Not using "reuse address" on Windows means that in some cases
>>> (server crash? server restart?) you won't be able to bind to the
>>> socket you need.
>>>
>>> At least, that's my understanding. Hopefully someone with deeper
>>> understanding of this issue can tell us what to do...
>>>
>>> Maybe someone should consult with one of the JDK networking experts
>> Working with the nio team on it.
>> -- Jeanfrancois
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>