use of org.webpieces.util.exceptions.NioException in project webpieces by deanhiller.
the class JdkSelectorImpl method select.
public Keys select() {
try {
int count = selector.select();
Set<SelectionKey> selectedKeys = selector.selectedKeys();
return new Keys(count, selectedKeys);
} catch (IOException e) {
throw new NioException(e);
}
}
use of org.webpieces.util.exceptions.NioException in project webpieces by deanhiller.
the class JdkSelectorImpl method startPollingThread.
public void startPollingThread(SelectorListener l, String threadName) {
if (running)
throw new IllegalStateException("Already running, can't start again");
this.listener = l;
try {
selector = provider.openSelector();
running = true;
thread = new PollingThread();
thread.setDaemon(true);
thread.setName(threadName);
thread.start();
} catch (IOException e) {
throw new NioException(e);
}
}
Aggregations