1. Your code only create an instance when you getPipeline(). <span class="Apple-style-span" style="font-family: Tahoma; font-size: 13px; ">executionHandler just provide a thread pool.</span><div><br></div><div>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).</div>
<div><br></div><div><br><br>
<br><br><div class="gmail_quote">在 2011年10月21日 上午10:25,Liuxianning <span dir="ltr"><<a href="mailto:liuxianning@huawei.com">liuxianning@huawei.com</a>></span>写道:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<p>Hi Guys</p>
<p> </p>
<p> 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</p>
<p> </p>
<p> public ChannelPipeline getPipeline()<br>
throws Exception<br>
{<br>
ChannelPipeline pipeline = Channels.pipeline();<br>
pipeline.addLast("decoder", new MessageDecoder());<br>
pipeline.addLast("ThreadPoolHandler", executionHandler);<br>
pipeline.addLast("handler", new ClientHandler());<br>
return pipeline;<br>
}</p>
<p> </p>
<p>the code get response as follows:</p>
<p> </p>
<p> ClientHandler handler = channel.getPipeline().get(ClientHandler.class);<br>
return handler.getResponse(request);</p>
<p> </p>
<p>My problem is:</p>
<p> 1. is there only one ClientHandler instance even I used ExecutionHandler?</p>
<p> 2. When there is multi-thread send request, all the get response is blocked in the ClientHandler, How should i improve the client concurrency?</p>
<p> </p>
<p>Any suggestion is many thanks.</p>
<p> </p>
<p>Sincerely</p>
<p>Liuxianning.</p>
<p> </p>
</div>
</div>
<br>_______________________________________________<br>
netty-users mailing list<br>
<a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br></blockquote></div><br></div>