On Tue, Jun 30, 2009 at 7:26 PM, Kumar Phani<[email protected]> wrote:
> Hi ,
>
>
>
> --------------------------------------------------------------------------------------------Code--------------------------------------
>
>
> acceptor = new NioSocketAcceptor(Runtime.getRuntime().availableProcessors()
> + 1);

This is default behavior, no need for this. Its equivalent to
acceptor = new NioSocketAcceptor();

// Add this
acceptor.setDefaultLocalAddress(new InetSocketAddress(80));

>
>
>        DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();
>        acceptor.setReuseAddress(true);
>
>        ThreadPoolExecutor threadPool = new
> ThreadPoolExecutor(1000,2000,600L,
>                TimeUnit.SECONDS,new ArrayBlockingQueue<Runnable>(1000),new
>                ThreadPoolExecutor.CallerRunsPolicy());
>        int threadNum = threadPool.prestartAllCoreThreads();
>        log.debug("Number of Threads---"+threadNum);
>
>
>
>        acceptor.getFilterChain().addFirst("log", new LoggingIOFilter());
>        acceptor.getFilterChain().addLast(
>            "protocol"
>        ,    new ProtocolCodecFilter(new GRTxCodecFactory())
>        );
>        chain.addLast("threadPool", new ExecutorFilter(threadPool));

This is how I add an Executor
filterChain.addLast("executor", new
ExecutorFilter(Executors.newCachedThreadPool()));

>        acceptor.setHandler( new GRTxServerHandler(this, listener));
>

// Add this
acceptor.bind();

>
> -------------------------------------------------------------------------------------------Code--------------------------------------
>
> Actually I am trying with this code after your valuable suggestion.
> Correct me if I am wrong..
> But it is not taking Multiple Client requests simultaneoulsy.
> help me..

What is happening then? How exactly you determine that its not taking
multiple requests?
If you could explain what you did and what happened, then only we can
provide some input

-- 
thanks
ashish

Reply via email to