title: Difference between socketChannel.register() and key.interestOps()?
body: <p>What's the deference   between <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/channels/spi/AbstractSelectableChannel.html#register%28java.nio.channels.Selector,%20int,%20java.lang.Object%29" rel="nofollow noreferrer"><code>SocketChannel.register()</code></a>  and   <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/channels/SelectionKey.html#interestOps%28%29" rel="nofollow noreferrer"><code>SelectionKey.interestOps()</code></a>?</p>
  
  <p>In the echo NIO server found <a href="https://stackoverflow.com/questions/17556901/java-high-load-nio-tcp-server">in this SO question</a>,
  for every key that is accepted, a register is called for a read op.  Then once a message is read, the register is called again for a write op.  However, after writing a message, rather than registering another read op it calls <code>key.interestOps(SelectionKey.OP_READ)</code>.</p>
  
  <p>Why the difference?  </p>