Netty Client concurrency
金剑
jinjian.1 at gmail.com
Sat Oct 22 09:25:16 EDT 2011
1. Your code only create an instance when you getPipeline(). executionHandler
just provide a thread pool.
2. One client is one connection, if you want to send multiple request, you
can use multiple connection or pipeline your request(If your server or
protocol support it).
在 2011年10月21日 上午10:25,Liuxianning <liuxianning at huawei.com>写道:
> Hi Guys
>
>
>
> There are 2 Modules in my project. I used Netty as channel between
> them.I used the long connection. In the pipelinefactory of clientside
> module, the code as follows
>
>
>
> public ChannelPipeline getPipeline()
> throws Exception
> {
> ChannelPipeline pipeline = Channels.pipeline();
> pipeline.addLast("decoder", new MessageDecoder());
> pipeline.addLast("ThreadPoolHandler", executionHandler);
> pipeline.addLast("handler", new ClientHandler());
> return pipeline;
> }
>
>
>
> the code get response as follows:
>
>
>
> ClientHandler handler =
> channel.getPipeline().get(ClientHandler.class);
> return handler.getResponse(request);
>
>
>
> My problem is:
>
> 1. is there only one ClientHandler instance even I used ExecutionHandler?
>
> 2. When there is multi-thread send request, all the get response is
> blocked in the ClientHandler, How should i improve the client concurrency?
>
>
>
> Any suggestion is many thanks.
>
>
>
> Sincerely
>
> Liuxianning.
>
>
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20111022/19865fbc/attachment.html
More information about the netty-users
mailing list