}
return selected;
}
private int selectImpl(long timeout) throws IOException {
INetworkSystem os = Platform.getNetworkSystem();
int[] readyChannels = null;
boolean isBlock = (SELECT_NOW != timeout);
if (keys.size() == 0) {
return 0;
}
prepareChannels();
try {
if (isBlock) {
begin();
}
readyChannels = os.select(readable, writable, timeout);
} finally {
if (isBlock) {
end();
}
}