[ 
https://issues.apache.org/jira/browse/DIRMINA-596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647575#action_12647575
 ] 

Emmanuel Lecharny commented on DIRMINA-596:
-------------------------------------------

A fully working sample would help to analyze the situation. The drops of code 
we currently have are not enough ...

Thanks !

> Sessions generated by NioSocketConnector cannot be closed in time (within 
> MINA2.0 M1,M2)
> ----------------------------------------------------------------------------------------
>
>                 Key: DIRMINA-596
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-596
>             Project: MINA
>          Issue Type: Bug
>          Components: Core, Transport
>    Affects Versions: 2.0.0-M1, 2.0.0-M2
>         Environment: MINA:mina-core-2.0.0-M2-20080427.091119-1.jar
> JDK: java version "1.5.0_05"
> Plat: Windows XP
>            Reporter: Silver
>
> I use MINA 2.0.0 M1 and M2 to build my application.
> When I use one NioSocketConnector to generate 10 sessions and then close them 
> in the messageReceived event of each session, only 5 or 6 sessions(that is to 
> say, not of all sessions)  can be closed correctly, others cannot, but I can 
> receive the sessionClosed event. The number of the closed sessions varies 
> from 2-6 during my experiments.
> Another intersting event will occur:
>    Since the rest sessions cannot be closed, I tried to generate a new 
> session by the same NioSocketConnector, then all of the 10 "old" sessions 
> were closed as one might expect, except the last new session.
> the main method:
> public static void main(String[] args)
> {
>         NioSocketConnector acceptor = new NioSocketConnector();
>         acceptor.setDefaultRemoteAddress(new InetSocketAddress("127.0.0.1", 
> 2361));
>         acceptor.getFilterChain().addLast( "executor", new 
> ExecutorFilter(100) );
>         acceptor.setHandler( new TimeServerHandler() );
>         for(int i=0; i<10; i++)
>             acceptor.connect();
> }
> the messageReceived method in TimeServerHandler class:
> public void messageReceived(IoSession session, Object message)
>             throws Exception
> {
>         System.out.println(((IoBuffer) 
> message).getString(Charset.forName("UTF-8")
>                 .newDecoder()));
>         session.close();
> }
> the log of the test server:
> 2008-5-27 17:09:32 Connected ++++++++++++++++++++++++127.0.0.1 / 3211>
> 2008-5-27 17:09:32 Connected ++++++++++++++++++++++++127.0.0.1 / 3212>
> 2008-5-27 17:09:32 Connected ++++++++++++++++++++++++127.0.0.1 / 3213>
> 2008-5-27 17:09:32 Connected ++++++++++++++++++++++++127.0.0.1 / 3214>
> 2008-5-27 17:09:32 Connected ++++++++++++++++++++++++127.0.0.1 / 3215>
> 2008-5-27 17:09:32 Connected ++++++++++++++++++++++++127.0.0.1 / 3216>
> 2008-5-27 17:09:32 Connected ++++++++++++++++++++++++127.0.0.1 / 3217>
> 2008-5-27 17:09:32 Connected ++++++++++++++++++++++++127.0.0.1 / 3218>
> 2008-5-27 17:09:32 Connected ++++++++++++++++++++++++127.0.0.1 / 3219>
> 2008-5-27 17:09:32 Connected ++++++++++++++++++++++++127.0.0.1 / 3220>
> 2008-5-27 17:09:32 Disconnected -----------------------127.0.0.1 / 3211>
> 2008-5-27 17:09:32 Disconnected -----------------------127.0.0.1 / 3213>
> 2008-5-27 17:09:32 Disconnected -----------------------127.0.0.1 / 3214>
> 2008-5-27 17:09:32 Disconnected -----------------------127.0.0.1 / 3212>
> 2008-5-27 17:09:32 Disconnected -----------------------127.0.0.1 / 3216>
> 2008-5-27 17:09:32 Disconnected -----------------------127.0.0.1 / 3215>
> 2008-5-27 17:09:37 Connected ++++++++++++++++++++++++127.0.0.1 / 3221>
> 2008-5-27 17:09:37 Disconnected -----------------------127.0.0.1 / 3217>
> 2008-5-27 17:09:37 Disconnected -----------------------127.0.0.1 / 3218>
> 2008-5-27 17:09:37 Disconnected -----------------------127.0.0.1 / 3219>
> 2008-5-27 17:09:37 Disconnected -----------------------127.0.0.1 / 3220>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to