You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by Pavel Zdeněk <pa...@gmail.com> on 2009/05/29 18:05:29 UTC

Re: client connect timeout at sumup example

maxbox@directbox.com 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

Re: client connect timeout at sumup example

Posted by Pavel Zdeněk <pa...@gmail.com>.
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:
>   
>> maxbox@directbox.com 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
>>
>>
>>     
>
>   


Re: client connect timeout at sumup example

Posted by maxbox <ma...@directbox.com>.
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:
> 
> maxbox@directbox.com 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
> 
> 

-- 
View this message in context: http://www.nabble.com/client-connect-timeout-at-sumup-example-tp23781640p23784510.html
Sent from the Apache MINA User Forum mailing list archive at Nabble.com.