if (isPooled) {
try {
tcpConnection = pool.getNonBlockingConnection(host, port, isSSL);
} catch (IOException ioe) {
throw new ConnectException("could not connect to " + host + ":" + port);
}
} else {
try {
if (sslCtx != null) {
tcpConnection = new NonBlockingConnection(host, port, sslCtx, true);
((NonBlockingConnection) tcpConnection).setWorkerpool(pool.getWorkerpool());
} else {
tcpConnection = new NonBlockingConnection(host, port);
((NonBlockingConnection) tcpConnection).setWorkerpool(pool.getWorkerpool());
}
} catch (IOException ioe) {
throw new ConnectException("could not connect to " + host + ":" + port + " reason: " + ioe.toString());
}
}
HttpClientConnection httpConnection = new HttpClientConnection(tcpConnection);
httpConnection.setResponseTimeoutMillis(responseTimeoutMillis);