// Apply options.
ch.getConfig().setPipelineFactory(getPipelineFactory());
ch.getConfig().setOptions(getOptions());
// Bind
ChannelFuture future = ch.bind(localAddress);
// Wait for the future.
future.awaitUninterruptibly();
if (!future.isSuccess()) {
future.getChannel().close().awaitUninterruptibly();