/**
* @return an {@link NIOTransport} based on the builder's configuration.
*/
public NIOTransport build() {
NIOTransport transport = create();
transport.setIOStrategy(ioStrategy);
if (workerConfig != null) {
transport.setWorkerThreadPoolConfig(workerConfig);
}
ThreadPoolConfig kernelLocal = kernelConfig;
if (kernelLocal != null) {
transport.setKernelThreadPoolConfig(kernelLocal);
} else {
kernelLocal = ThreadPoolConfig.defaultConfig();
transport.setKernelThreadPoolConfig(kernelLocal);
}
transport.setSelectorProvider(selectorProvider);
transport.setSelectorHandler(selectorHandler);
transport.setSelectionKeyHandler(selectionKeyHandler);
transport.setMemoryManager(memoryManager);
transport.setAttributeBuilder(attributeBuilder);
transport.setSelectorRunnersCount(selectorRunnerCount);
transport.setNIOChannelDistributor(nioChannelDistributor);
transport.setProcessor(processor);
transport.setProcessorSelector(processorSelector);
transport.setClientSocketSoTimeout(clientSocketSoTimeout);
transport.setConnectionTimeout(connectionTimeout);
transport.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS);
transport.setWriteTimeout(writeTimeout, TimeUnit.MILLISECONDS);
transport.setReadBufferSize(readBufferSize);
transport.setWriteBufferSize(writeBufferSize);
transport.setReuseAddress(reuseAddress);
transport.setOptimizedForMultiplexing(isOptimizedForMultiplexing());
transport.getAsyncQueueIO()
.getWriter()
.setMaxPendingBytesPerConnection(
maxPendingBytesPerConnection);
return transport;
}