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 (JIRA)" <ji...@apache.org> on 2005/06/08 13:24:30 UTC

[jira] Created: (DIRMINA-58) Session Idle time not working

Session Idle time not working
-----------------------------

         Key: DIRMINA-58
         URL: http://issues.apache.org/jira/browse/DIRMINA-58
     Project: Directory MINA
        Type: Bug
    Versions: 0.7.2    
 Environment: WinXP SP2, java version "1.5.0_03"
    Reporter: Horia Muntean
 Assigned to: Trustin Lee 


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/).
 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.

As Julien Vermillard suggested, I was trying to move 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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-58) Session Idle time not working

Posted by "Horia Muntean (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-58?page=comments#action_12313090 ] 

Horia Muntean commented on DIRMINA-58:
--------------------------------------

Mike you are right. 

I kept session.getConfig().setIdleTime(IdleStatus.BOTH_IDLE, 5);  inside sessionOpened callback and after exchanging some data with the server, the sessionIdle callback fired.

Regards,
Horia

> Session Idle time not working
> -----------------------------
>
>          Key: DIRMINA-58
>          URL: http://issues.apache.org/jira/browse/DIRMINA-58
>      Project: Directory MINA
>         Type: Bug
>     Versions: 0.7.2
>  Environment: WinXP SP2, java version "1.5.0_03"
>     Reporter: Horia Muntean
>     Assignee: Trustin Lee

>
> 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/).
>  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.
> As Julien Vermillard suggested, I was trying to move 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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (DIRMINA-58) Session Idle time not working

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DIRMINA-58?page=all ]
     
Trustin Lee resolved DIRMINA-58:
--------------------------------

    Fix Version: 0.7.3
     Resolution: Fixed

Mike, thanks for giving us a great clue for this issue.

I checked in the fix and deployes 0.7.3-SNAPSHOT JAR.  Horia, could you please test it and close this issue?

Trustin

> Session Idle time not working
> -----------------------------
>
>          Key: DIRMINA-58
>          URL: http://issues.apache.org/jira/browse/DIRMINA-58
>      Project: Directory MINA
>         Type: Bug
>     Versions: 0.7.2
>  Environment: WinXP SP2, java version "1.5.0_03"
>     Reporter: Horia Muntean
>     Assignee: Trustin Lee
>      Fix For: 0.7.3

>
> 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/).
>  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.
> As Julien Vermillard suggested, I was trying to move 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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DIRMINA-58) Session Idle time not working

Posted by "Horia Muntean (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DIRMINA-58?page=all ]
     
Horia Muntean closed DIRMINA-58:
--------------------------------


Now (with mina-0.7.3-SNAPSHOT.jar), the telnet session is terminated after timeout expires even if no data has been exchanged between client and server. The session timeout is configured inside sessionOpened callback.

> Session Idle time not working
> -----------------------------
>
>          Key: DIRMINA-58
>          URL: http://issues.apache.org/jira/browse/DIRMINA-58
>      Project: Directory MINA
>         Type: Bug
>     Versions: 0.7.2
>  Environment: WinXP SP2, java version "1.5.0_03"
>     Reporter: Horia Muntean
>     Assignee: Trustin Lee
>      Fix For: 0.7.3

>
> 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/).
>  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.
> As Julien Vermillard suggested, I was trying to move 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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRMINA-58) Session Idle time not working

Posted by "Mike Heath (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DIRMINA-58?page=comments#action_12313066 ] 

Mike Heath commented on DIRMINA-58:
-----------------------------------

I have experienced the same problem but I have noticed that it works fine once data is sent to the server.

> Session Idle time not working
> -----------------------------
>
>          Key: DIRMINA-58
>          URL: http://issues.apache.org/jira/browse/DIRMINA-58
>      Project: Directory MINA
>         Type: Bug
>     Versions: 0.7.2
>  Environment: WinXP SP2, java version "1.5.0_03"
>     Reporter: Horia Muntean
>     Assignee: Trustin Lee

>
> 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/).
>  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.
> As Julien Vermillard suggested, I was trying to move 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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira