List of usage examples for io.netty.bootstrap AbstractBootstrap bind
public ChannelFuture bind(SocketAddress localAddress)
From source file:com.streamsets.pipeline.lib.network.BaseNettyServer.java
License:Apache License
public void listen() throws Exception { for (SocketAddress address : addresses) { AbstractBootstrap b = bootstrap(enableEpoll); LOG.info("Starting server on address {}", address); if (enableEpoll) { // for epoll, bind for each thread for (int i = 0; i < numThreads; i++) { ChannelFuture channelFuture = b.bind(address).sync(); channelFutures.add(channelFuture); }/*from w w w .j av a 2 s. co m*/ } else { // for non-epoll (NIO threadpool), bind once ChannelFuture channelFuture = b.bind(address).sync(); channelFutures.add(channelFuture); } } }