if the  timer is started implicitly and shared ,  what is the start point for an individual connection?<br><div>channelOpened?  </div><div><br></div><div>Or can I use one timer for each connection to achieve a more accurate start point control?</div>
<div><br></div><div>Centaur<br></div><div>20100324</div><div><br></div><div class="gmail_quote">2010/3/24 &quot;Trustin Lee (이희승)&quot; <span dir="ltr">&lt;<a href="mailto:trustin@gmail.com">trustin@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Timer is shared by many connections, and therefore it&#39;s not efficient to<br>
call Timer.start() in channelConnected().  If you want to start the<br>
timer thread explicitly before communication starts, you&#39;d better call<br>
Timer.start() before calling ServerBootstrap.bind() or<br>
ClientBootstrap.connect().<br>
<br>
HTH,<br>
Trustin<br>
<div><div class="h5"><br>
谢非 wrote:<br>
&gt; hi all,<br>
&gt;<br>
&gt;     I need to start the timeout timer in channelConnected() event handler of<br>
&gt; a ReadTimeoutHandler subclass, but it seems that there is no protected<br>
&gt; getTimer() in ReadTimeoutHandler.<br>
&gt;     should I store the timer as a member field like this:<br>
&gt;<br>
&gt;       class ServerReadTimeoutHandler extends ReadTimeoutHandler {<br>
&gt;              Timer timer;<br>
&gt;<br>
&gt;              public ServerReadTimeoutHandler(Timer timer, int<br>
&gt; timeoutSeconds) {<br>
&gt;                          super(timer, timeoutSeconds);<br>
&gt;                           this.timer = timer;<br>
&gt;              }<br>
&gt;<br>
&gt;             @Override<br>
&gt;             public void channelConnected(ChannelHandlerContext ctx,<br>
&gt; ChannelStateEvent e) throws Exception {<br>
&gt;                  timer.start();<br>
&gt;                  super.channelConnected(ctx, e);<br>
&gt;             }<br>
&gt;      }<br>
&gt;<br>
&gt; Centaur<br>
&gt; 20100318<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; netty-users mailing list<br>
&gt; <a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
<font color="#888888"><br>
--<br>
what we call human nature in actuality is human habit<br>
<a href="http://gleamynode.net/" target="_blank">http://gleamynode.net/</a><br>
<br>
<br>
</font><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>