dev@glassfish.java.net

Re: [FYI] More frequent BindException to occur

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Fri, 30 Oct 2009 15:27:58 -0400

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
>