You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Nathanael Van Vorst (JIRA)" <ji...@apache.org> on 2008/06/10 21:15:45 UTC

[jira] Commented: (DIRMINA-596) Sessions generated by NioSocketConnector cannot be closed in time (within MINA2.0 M1,M2)

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

Nathanael Van Vorst commented on DIRMINA-596:
---------------------------------------------

I see something similar. I am using a NioSocketConnector with a SslFilter. I maintain a 100 or so connections to many different servers. When I close a connected session I close it immediately (session.close()). The sessions with certain servers sometimes take a very long time to close -- seconds to even minutes. The figure this out I used the CloseFuture returned from the close() operation rather than the sessionClosed event.

Not sure if this tidbit helps......

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