/** * Creates a new {@link IOHub} instance. * * @param executor the {@link Executor} to use for running tasks. * @throws IOException if the hub's {@link Selector} cannot be opened. */ private IOHub(Executor executor) throws IOException { this.selector = Selector.open(); this.ioHubRunning = true; this.executor = executor; this.bufferPool = new DirectByteBufferPool(16916, Runtime.getRuntime().availableProcessors() * 4); }