Filter.sessionCreated/Filter.sessionOpened called AFTER Filter.filterWrite... -----------------------------------------------------------------------------
Key: DIRMINA-284 URL: http://issues.apache.org/jira/browse/DIRMINA-284 Project: Directory MINA Issue Type: Bug Components: Core, Filter Affects Versions: 1.0 Reporter: Michael Newcomb Using the sumup example: Move the following code out of ClientSessionHandler.sessionOpened(): for( int i = 0; i < values.length; i++ ) { AddMessage m = new AddMessage(); m.setSequence( i ); m.setValue( values[ i ] ); session.write( m ); } And put it into the Client right after: ConnectFuture future = connector.connect( new InetSocketAddress( HOSTNAME, PORT ), new ClientSessionHandler( values ), cfg ); future.join(); session = future.getSession(); And you will see the following in the Client console: Oct 13, 2006 11:19:05 AM org.apache.mina.util.SessionLog info INFO: [localhost/127.0.0.1:8080] CREATED Oct 13, 2006 11:19:05 AM org.apache.mina.util.SessionLog info INFO: [localhost/127.0.0.1:8080] WRITE: 0:ADD(5) Oct 13, 2006 11:19:05 AM org.apache.mina.util.SessionLog info INFO: [localhost/127.0.0.1:8080] OPENED Oct 13, 2006 11:19:05 AM org.apache.mina.util.SessionLog info INFO: [localhost/127.0.0.1:8080] WRITE: 1:ADD(45) Oct 13, 2006 11:19:05 AM org.apache.mina.util.SessionLog info INFO: [localhost/127.0.0.1:8080] WRITE: 2:ADD(334) In this run, only OPENED happened after the WRITE, but in my real application CREATED and OPENED happen *after* a WRITE on the Session. IMHO, ConnectFuture.join(), should ensure that Session.sessionCreated and Session.sessionOpened have been called. Michael -- 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