title: Is there epoll equivalent in Java?
body: <p>Is there an equivalent of Linux epoll in Java?</p>
  
  <p>epoll allows a thread to react to a number of heterogenous events.  For instance, I can have a thread that reacts to either a socket event or an input from the console.  In C++ I can implement this by registering stdio and the socket with epoll.  My thread will be triggered by an event from either if these.</p>
  
  <p>Is there a similar facility in Java?  I looked at the nio package, it allows me to register a number of sockets with a selector.  But there does not seem to be away to register the console / standard io with a selector.  Am I not seeing something?  Is there another way to do this?</p>
  
  <p>On the "why": I want to write a program that communicates via sockets, and i want to drive this program by entering commands from console.  I know how this can be done by separating console input and the communications to different threads, but i am curious whether there is a way to do this in a single thread.</p>
  
  <p>Thanks.
  df</p>