<br><div class="gmail_quote">On Fri, Mar 6, 2009 at 7:17 PM, Patrizio Munzi <span dir="ltr">&lt;<a href="mailto:patrizio.munzi@eris4.com">patrizio.munzi@eris4.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Frederic,<br>
thanks for your tips.<br>
;-)<br>
In particular that one on ChannelGroup, it solved the problem in my other post.<br>
<br>
About OrderedMemoryAwareThreadPoolExecutor I don&#39;t think I need it.<br>
<br>
BR,<br>
   Patrizio<div><div></div><div class="h5"><br>
<br>
Frederic Bregier wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Patrizio,<br>
<br>
For me, you have almost all.<br>
<br>
I could suggest the following:<br>
- adding the .setOption(&quot;reuseAddress&quot;, true)    both on server (using &quot;child.reuseAddress&quot;) and client sides<br>
<br>
- adding if necessary an OrderedMemoryAwareThreadPoolExecutor in your<br>
pipeline<br>
  (that you could create once for all connections and reuse it)<br>
  bewteen you &quot;encoder&quot; and &quot;handler&quot;. This is only needed if your handler<br>
  is doing stuff like database, file access, or any heavy computations.<br>
  Heavy can depend on each case of software, so it is up to you to check<br>
  if it is better or not.<br>
<br>
- perhaps using DefaultChannelGroup to add any created channel to it<br>
  (either in client or server) in order to allow a shutdown of Netty<br>
  more easily:<br>
<br>
  In your &quot;handler&quot;, you can add in the channelConnected a<br>
&quot;myChannelGroup.add(channel)&quot;<br>
<br>
  Again in the &quot;handler&quot; in channelClosed, add a<br>
&quot;myChannelGroup.remove(channel)&quot;<br>
<br>
  And finaly in your global exit command (like shutdown in your other post):<br>
  myChannelGroup.close().awaitUninterruptibly(); // it should close all<br>
opened<br>
      // channel, even the father in Server version<br>
  then your &quot;orderedMemoryAwareThreadPoolExecutor&quot;.shutdownNow(); // if you<br>
added one<br>
  then your &quot;channelFactory&quot; (from new NioXXXSocketChannelFactory)<br>
        &quot;channelFactory&quot;.releaseExternalResources(); // should release all<br>
internals<br>
    // like thread pools.<br>
<br>
I think it is all... ;-)<br>
  HTH,<br>
Frederic<br>
<br>
-----<br>
Hardware/Software Architect<br>
  <br>
</blockquote>
<br>
-- <br>
<br></div></div>
*Patrizio Munzi*<br>
</blockquote></div><br><br>
Hi Frederic,<br>

<br>

Thank you very much for sharing these tips with us. The tips will also be very useful for me too!! :)<br>

<br>

Cheers!<br>

<br>

Virat<br>