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 "Trustin Lee (이희승)" <span dir="ltr"><<a href="mailto:trustin@gmail.com">trustin@gmail.com</a>></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's not efficient to<br>
call Timer.start() in channelConnected(). If you want to start the<br>
timer thread explicitly before communication starts, you'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>
> hi all,<br>
><br>
> I need to start the timeout timer in channelConnected() event handler of<br>
> a ReadTimeoutHandler subclass, but it seems that there is no protected<br>
> getTimer() in ReadTimeoutHandler.<br>
> should I store the timer as a member field like this:<br>
><br>
> class ServerReadTimeoutHandler extends ReadTimeoutHandler {<br>
> Timer timer;<br>
><br>
> public ServerReadTimeoutHandler(Timer timer, int<br>
> timeoutSeconds) {<br>
> super(timer, timeoutSeconds);<br>
> this.timer = timer;<br>
> }<br>
><br>
> @Override<br>
> public void channelConnected(ChannelHandlerContext ctx,<br>
> ChannelStateEvent e) throws Exception {<br>
> timer.start();<br>
> super.channelConnected(ctx, e);<br>
> }<br>
> }<br>
><br>
> Centaur<br>
> 20100318<br>
><br>
><br>
><br>
</div></div>> ------------------------------------------------------------------------<br>
><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>
<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>