I don't think the TIME_WAIT connections are related to MINA. You can
read about TIME_WAIT here:
http://www.port80software.com/200ok/archive/2004/12/07/205.aspx

/Niklas

James-Usertunnel wrote:
> Hi There
> 
>  
> 
> I add the code config.setReuseAddress(true) into the server 
> 
> After the server started I also use 'kill' to stop this server there are
> always several tcp
> 
>  connections in TIME_WAIT not as the same as former situation FIN_WAIT1 OR
> FIN_WAIT2
> 
> Thanks Avanced
> 
>  
> 
>  
> 
> Codes as follows(Environment MINA0.9.4,JRE1.5.0.07)
> 
> acceptor = new SocketAcceptor();
> 
> SocketAcceptorConfig config = new SocketAcceptorConfig();
> 
> config.setDisconnectOnUnbind(true);
> 
> config.setReuseAddress(true);
> 
> acceptor.bind(new InetSocketAddress(PORT), new EchoProtocolHandler(),
> 
>                                      config);
> 
>  
> 
> ________________________________
> 
> 发件人: James [mailto:[EMAIL PROTECTED] 
> 发送时间: 2006年6月26日 15:14
> 收件人: '[email protected]'
> 主题: Re: problem of MINA Server-Side on linux
> 
>  
> 
>  
> 
> Hi,
> 
>  
> 
> What version of MINA are you using? Which JRE?
> 
>  
> 
> If using MINA 0.9.4 you should make sure you set reuseAddress to true
> 
> when binding. This is a property in the SocketAcceptorConfig which you
> 
> can pass to bind()
> 
>  
> 
> SocketAcceptorConfig config = new SocketAcceptorConfig();
> 
> config.setReuseAddress(true);
> 
> acceptor = new SocketAcceptor();
> 
> acceptor.bind(address, handler, config);
> 
>  
> 
> Or you can call
> 
>  
> 
> ((SocketAcceptorConfig ) acceptor.getDefaultConfig()).setReuseAddress(true)
> 
>  
> 
> before binding.
> 
>  
> 
> HTH
> 
>  
> 
> /Niklas
> 
>  
> 
> 凌晨 wrote:
> 
>> Hi there
> 
> 
>> We built a server on mina framework then running in linux(red hat as4
> update
> 
>> 2).Everytime We user 'kill' to stop this server there are always several
> tcp
> 
>> connections in FINWAIT.In this condition we restart the server a address
> 
>> already bind Exception will be thrown.So please tell me how to fix this
> 
>> problem.Otherwise we can only restart the server after a long time,waiting
> 
>> for the FINWAIT.Thanks a lot
> 
> 
> 
> 
> 


-- 
Niklas Therning
Software Architect
www.spamdrain.net

Reply via email to