setConnectTimeout : how long the client (your software) will be trying to make a connection to the server. setIdleTime : once you have a connection (session) you can say how long you allow it to do nothing.

maxbox napsal(a):
Okay i understand but i mean what kind of timeout is this from
// Configure the service.
connector.setConnectTimeoutMillis(CONNECT_TIMEOUT);

What is the difference between IoSessionConfig.setIdleTime and
AbstractIoConnector.setConnectTimeoutMillis?


Pavel Zdeněk wrote:
[email protected] napsal(a):
Hi,
can someone explain me some stuff from org.apache.mina.example.sumup?

ClientSessionHandler extends from IoHandlerAdapter and the api doc says
that "All methods do nothing by default." ClientSessionHandler does not
override the sessionIdle method. So is it correct that the line:
private static final long CONNECT_TIMEOUT = 30*1000L; // 30 seconds
is never used?

Max
No, it is used in main() method. The connect timeout is a property of IoConnector, not of IoHandlerAdapter. SessionIdle may happen only on opened session (i.e. succesfuly connected). First you connect to server, and sessionCreated event happen at least. Only then you may get sessionIdle event. You drive that timeout by IoSessionConfig.set**IdleTime (being set in sessionCreated in the sumup example).

Pavel




Reply via email to