Thanks for shedding light on this topic, Emmanuel!

I'll read the article you recommended.

Zhijun

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Emmanuel
Lecharny
Sent: Tuesday, June 02, 2009 8:03 AM
To: [email protected]
Subject: Re: java.net.BindException: Address already in use

On Tue, Jun 2, 2009 at 1:47 PM, Zhijun Sheng <[email protected]>
wrote:
> Hi, Alex,
>
> Thank you!  But I think I used this line before and removed it later
because I saw some posts in the forum saying that this is not necessary
since a fix was made in mina.

There is no fix in MINA to solve what is not an issue. If you set the
ReuseAddress parameter, then you have a workaround. But this can't be
the generic approach.

Usually, you must try to stop the server closing all the connections,
otherwise you get stuck with this error until all the socket in
TIME_WAIT state are freed by your systeM; And it can take a while (300
seconds AFAIR on linux). You can also set a lower time for such
timeout, but this is not necessarily a good idea, from the security
POV.

Some good explanations about this situation :
http://hea-www.harvard.edu/~fine/Tech/addrinuse.html

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Reply via email to