/** * Creates a new instance. * * @param workerPool * the {@link WorkerPool} which will be used to obtain the {@link Worker} that execute * the I/O worker threads * @param family * the {@link InternetProtocolFamily} to use. This should be used for UDP multicast. * <strong>Be aware that this option is only considered when running on java7+</strong> */ public NioDatagramChannelFactory(WorkerPool<NioDatagramWorker> workerPool, InternetProtocolFamily family) { this.workerPool = workerPool; this.family = family; sink = new NioDatagramPipelineSink(workerPool); }
/** * Create a new {@link NioDatagramChannelFactory} with a {@link Executors#newCachedThreadPool()}. * * See {@link #NioDatagramChannelFactory(Executor)} */ public NioDatagramChannelFactory(InternetProtocolFamily family) { workerPool = new NioDatagramWorkerPool(Executors.newCachedThreadPool(), SelectorUtil.DEFAULT_IO_THREADS); this.family = family; sink = new NioDatagramPipelineSink(workerPool); releasePool = true; }
public NioClientDatagramChannelFactory(WorkerPool<NioWorker> workerPool) { this.workerPool = workerPool; this.family = null; sink = new NioDatagramPipelineSink(); releasePool = true; }
public NioServerDatagramChannelFactory(Executor bossExecutor, int bossCount, WorkerPool<NioWorker> workerPool) { bossPool = new NioDatagramBossPool(bossExecutor, bossCount, null); this.workerPool = workerPool; this.family = null; sink = new NioDatagramPipelineSink(); childSink = new NioChildDatagramPipelineSink(); releasePool = true; }