try {
RubyThread thread = context.getThread();
while (true) {
boolean ready = thread.select(this, SelectionKey.OP_ACCEPT);
if (!ready) {
// we were woken up without being selected...poll for thread events and go back to sleep
context.pollThreadEvents();