Hi, Emmanuel,
I did try to call IoSession.close(true) on all the current connections on my
server and also
for (int i = 0; i < acceptors.length; i++) {
logger.info("running acceptor.unbind() ...");
acceptors[i].unbind();
logger.info("running acceptor.dispose() ...");
acceptors[i].dispose();
}
but couldn't get rid of the subjected problem.
Could you tell me what I did it wrongly?
Thx!
Zhijun
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Emmanuel
Lecharny
Sent: Tuesday, June 02, 2009 8:17 AM
To: [email protected]
Subject: Re: java.net.BindException: Address already in use
On Tue, Jun 2, 2009 at 2:03 PM, Zhijun Sheng <[email protected]>
wrote:
> A quick try on my dev server shows a big difference with the following
line added (thx Alex!)
>
> nioSocketAcceptor.setReuseAddress(true);
>
> The "addr already used" problem is gone!
>
> I'll try it on the production server later.
You should not use such an option on a production server ... You'd
better close the listening socket correctly !
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com