private synchronized void bootstrap(Connection.Settings connectionSettings) { if (bootstrap == null) { bootstrap = new Bootstrap(); bootstrap.group(eventLoopFactory.newClientWorkerEventLoopGroup()) .channel(eventLoopFactory.clientSocketChannelClass()) .handler(new Initializer()) .option(TCP_NODELAY, true) .option(SO_KEEPALIVE, true) .option(ALLOCATOR, PooledByteBufAllocator.DEFAULT) .option(CONNECT_TIMEOUT_MILLIS, connectionSettings.connectTimeoutMillis()); for (ChannelOptionSetting setting : httpConfig.channelSettings()) { bootstrap.option(setting.option(), setting.value()); } } }