You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by peter royal <pr...@apache.org> on 2006/07/04 23:10:48 UTC

Re: A little confused about the many timeouts

On Jun 29, 2006, at 11:02 PM, Claudio Miranda wrote:
> 	I am a little confused about the timeouts.
> 	I would like a little bit of explanations of what does mean and  
> its consequences the following timeouts:
>
>
> IoConnectorConfig.setConnectTimeout(int connectTimeout)
>
>  if the client could not establish a connection with the server in
>  connectTimeout = 30 seconds, what happens ?
>  Tried to connect to a non existent server, then a
> "java.net.ConnectException: Connection refused" was throw
>
>  or when the server could not accept the connection at the  
> specidied timeout ?

You weren't successful in tricking the system in connecting to  
something non-existent. Try a service that just doesn't respond to  
your packets, then the connect timeout should behave a bit better.

> SocketConnector.setWorkerTimeout(long workerTimeout)
> IoSession.setWriteTimeout(int writeTimeout)
> IoSession.setIdleTime(IdleStatus status, int idleTime)
>
> 	So, which timeout, when specified on the client will cause the  
> connection to be closed, when it is reached ?

none.

what you want is to set IoSession.setIdleTime(), and then in  
IoHandler.sessionIdle(), react to that by doing what you want, which  
sounds like closing the connection.

-pete

-- 
proyal@apache.org - http://fotap.org/~osi