Le 9/26/13 3:40 AM, praveen a écrit :
> Hi,
> I have written the following code and trying to open client socket ports
> but unable to open more than 1000 ports..
That is extremely strange. Do you have a firewall installed that limits
the number of connections you can create ?
> The system configuration is 32 GB
> Ram,16 cores Intel processor and OS is windows server 2008.
>
>
> IoConnector connector = new NioSocketConnector();
>
> connector.getFilterChain().addLast("codec",new
> ProtocolCodecFilter(new TextLineCodecFactory(Charset.forName("UTF-8"))));
>
> connector.setHandler(new MinaClientHandler_executor("hello server"));
> //connector.se
> ConnectFuture future =
> connector.connect(new
> InetSocketAddress(serverIP,serverPort), new
> InetSocketAddress(InetAddress.getLocalHost().getHostAddress(),portNumber));
>
>
> future.awaitUninterruptibly();
>
> When I monitored the application through JConsole I observed that for each
> connection 3 threads are getting created. Is there any way to optimize the
> code..
Just use New NioSockectConnector(1). 1 is the number of IoProcessor
created, thus the number of threads created - it defaults to 3 -.
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com