// set the pipeline on the bootstrap
clientBootstrap.setPipeline(clientPipeline);
answer = clientBootstrap.connect(new InetSocketAddress(configuration.getHost(), configuration.getPort()));
return answer;
} else {
ConnectionlessBootstrap connectionlessClientBootstrap = new ConnectionlessBootstrap(datagramChannelFactory);
connectionlessClientBootstrap.setOption("child.keepAlive", configuration.isKeepAlive());
connectionlessClientBootstrap.setOption("child.tcpNoDelay", configuration.isTcpNoDelay());
connectionlessClientBootstrap.setOption("child.reuseAddress", configuration.isReuseAddress());
connectionlessClientBootstrap.setOption("child.connectTimeoutMillis", configuration.getConnectTimeout());
connectionlessClientBootstrap.setOption("child.broadcast", configuration.isBroadcast());
connectionlessClientBootstrap.setOption("sendBufferSize", configuration.getSendBufferSize());
connectionlessClientBootstrap.setOption("receiveBufferSize", configuration.getReceiveBufferSize());
// set the pipeline on the bootstrap
connectionlessClientBootstrap.setPipeline(clientPipeline);
// bind and store channel so we can close it when stopping
Channel channel = connectionlessClientBootstrap.bind(new InetSocketAddress(0));
ALL_CHANNELS.add(channel);
answer = connectionlessClientBootstrap.connect(new InetSocketAddress(configuration.getHost(), configuration.getPort()));
return answer;
}
}