You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by chinadeng <de...@163.com> on 2007/12/20 03:53:46 UTC

How can i improve the total numbers of session which server will handle connects from client

Hi:
 when 300 client connect to my servers at almost in same time ,
but the server only can handle 240 client ,60 client will be discarded.
    my server codes like fellowing :
 InetSocketAddress serverAddress1 = new InetSocketAddress(8008);
 DemuxingProtocolCodecFactory dpcf = new DemuxingProtocolCodecFactory();
dpcf.register(new CliEntCmdDeconder()); 
dpcf.register(new CliEntEncoder());
 SocketAcceptor acceptor = new
SocketAcceptor(Runtime.getRuntime().availableProcessors() + 1,
Executors.newCachedThreadPool()); 
SocketAcceptorConfig cfg = new SocketAcceptorConfig();
 cfg.setReuseAddress(true);
 DefaultIoFilterChainBuilder chain = cfg.getFilterChain(); 
chain.addLast("logger", new LoggingFilter()); 
chain.addLast("protocol", new ProtocolCodecFilter(dpcf));
 System.out.println("long on ....");
 DemuxingIoHandler iohanlder=new DemuxingIoHandler(); 
iohanlder.addMessageHandler(clicmdbro.class, new CliEntCmdHandler(testb));
 try { 
acceptor.bind(serverAddress1,iohanlder, cfg);
 } catch (IOException e) 
{ // TODO Auto-generated catch block 
e.printStackTrace()
; } 
how can i ressolve the problem??
 Thanks in Advance 
-- 
View this message in context: http://www.nabble.com/How-can-i-improve-the-total-numbers-of-session-which-server-will-handle-connects-from-client-tp14429831s16868p14429831.html
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.