You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Horia Muntean <ho...@gmail.com> on 2005/06/08 12:00:30 UTC

Session Idle time not working

Hello,

I was trying to configure a session to close itself in case of idle
time expiration. I am using mina-0.7.2.jar (grabbed from
http://cvs.apache.org/repository/directory-network/jars/) on a WinXP
box. The code follows:
<code>
    public void sessionCreated(ProtocolSession session) throws Exception {
        logger.debug("session created");
        session.getConfig().setIdleTime(IdleStatus.BOTH_IDLE, 5);
        session.getConfig().setWriteTimeout(5);
    }

    public void sessionIdle(ProtocolSession session, IdleStatus arg1)
throws Exception {
        logger.debug("session idle");
        session.close();
    }
</code>

Then I have just opened a telnet connection to the server and waited
for the connection go be cut off by the server but notging happens.
BTW, when I popup my telnet connection, sessionCreated and
sessionOpened are getting called on the server side.

Regards,
Horia

Re: Session Idle time not working

Posted by Trustin Lee <tr...@gmail.com>.
Hello Horia,
 Could you please post this issue to JIRA at 
http://issues.apache.org/jira/browse/DIRMINA so that we can track it?
 Trustin

 2005/6/8, Horia Muntean <ho...@gmail.com>: 
> 
> Hello,
> 
> I was trying to configure a session to close itself in case of idle
> time expiration. I am using mina-0.7.2.jar (grabbed from
> http://cvs.apache.org/repository/directory-network/jars/) on a WinXP
> box. The code follows:
> <code>
> public void sessionCreated(ProtocolSession session) throws Exception {
> logger.debug("session created");
> session.getConfig().setIdleTime(IdleStatus.BOTH_IDLE, 5);
> session.getConfig().setWriteTimeout(5);
> }
> 
> public void sessionIdle(ProtocolSession session, IdleStatus arg1)
> throws Exception {
> logger.debug("session idle");
> session.close();
> }
> </code>
> 
> Then I have just opened a telnet connection to the server and waited
> for the connection go be cut off by the server but notging happens.
> BTW, when I popup my telnet connection, sessionCreated and
> sessionOpened are getting called on the server side.
> 
> Regards,
> Horia
> 



-- 
what we call human nature is actually human habit
--
http://gleamynode.net/

Re: Session Idle time not working

Posted by Horia Muntean <ho...@gmail.com>.
I have moved the idle time configuration inside sessionOpened
callback, but I get the same result: the telnet session is not
terminated and sessionIdle is not called.
<code>
    public void sessionOpened(ProtocolSession session) throws Exception {
        logger.debug("session opened");
        session.getConfig().setIdleTime(IdleStatus.BOTH_IDLE, 5);
        logger.info("Idle time
is:"+session.getConfig().getIdleTime(IdleStatus.BOTH_IDLE));
    }
</code>

All I get is :
2005-06-08 13:45:39,171 DEBUG CLIENT - session created
2005-06-08 13:45:39,187 DEBUG CLIENT - session opened
2005-06-08 13:45:39,187 INFO  CLIENT - Idle time is:5

Regards,
Horia
On 6/8/05, Julien Vermillard <jv...@archean.fr> wrote:
> Le mercredi 08 juin 2005 à 13:00 +0300, Horia Muntean a écrit :
> > Hello,
> >
> > I was trying to configure a session to close itself in case of idle
> > time expiration. I am using mina-0.7.2.jar (grabbed from
> > http://cvs.apache.org/repository/directory-network/jars/) on a WinXP
> > box. The code follows:
> > <code>
> >     public void sessionCreated(ProtocolSession session) throws Exception {
> 
> Hi,
> 
> Try to do that in sessionOpened (it works for me). Anyway I reconize
> it's a trap, perhaps it shoudl throw somekind of exception if you
> configure the session IDLE before it was opened ?
> 
> Julien
> 
> 
> 
>

Re: Session Idle time not working

Posted by Julien Vermillard <jv...@archean.fr>.
Le mercredi 08 juin 2005 à 13:00 +0300, Horia Muntean a écrit :
> Hello,
> 
> I was trying to configure a session to close itself in case of idle
> time expiration. I am using mina-0.7.2.jar (grabbed from
> http://cvs.apache.org/repository/directory-network/jars/) on a WinXP
> box. The code follows:
> <code>
>     public void sessionCreated(ProtocolSession session) throws Exception {

Hi,

Try to do that in sessionOpened (it works for me). Anyway I reconize
it's a trap, perhaps it shoudl throw somekind of exception if you
configure the session IDLE before it was opened ?

Julien