SelectionKey key = nim.channel.register(selector, SelectionKey.OP_READ);
int n = selector.select(timeout);
if(n > 0) {
IRubyObject readItems = io.read(new IRubyObject[]{recv.getRuntime().newFixnum(1024*16)});
return buf.concat(readItems);
} else {
RubyClass exc = (RubyClass)(recv.getRuntime().getModule("Timeout").getConstant("Error"));
throw new RaiseException(RubyException.newException(recv.getRuntime(), exc, "execution expired"),false);
}
} catch(IOException exception) {