title: Flexible timeout mechanism in JBoss Netty?
body: <p>I am considering moving my Java NIO implementation over to <a href="http://www.jboss.org/netty" rel="nofollow">JBoss Netty</a> as it provides a much cleaner model than I have implemented. The implementation manages a number of client connections to components over TCP using a proprietary protocol. </p>
  
  <p>One aspect of my implementation, that I cannot see in Netty, is the ability to set arbitrary timeouts, which:</p>
  
  <ol>
  <li>Wait for some data to be read from the Component.  I know that Netty has a <code>ReadTimeoutHandler</code> but can the timeout value be changed/turned off easily by the Component as it moves through the state machine?</li>
  <li>Wait for time to elapse so that I can reconnect to the Component (to give the Component time to be restarted after a disconnect).  This is entirely unrelated to communication and is a simple timeout, however I'd like the timeout 'event/exception' to be presented to the handler class in the same manner as other communication-related timeouts.</li>
  </ol>
  
  <p>Can this timeout mechanism be accomplished using Netty?</p>
  
  <p><strong>Conclusion</strong>: Given I would need to implement a timeout mechanism, which would run within the its own thread, I am not going to convert to using Netty after all.</p>