throw new IllegalStateException("Open called on already open connection");
}
long startTime = System.currentTimeMillis();
try {
final SSLConnectionContext sslCxt = cpConfig.getSSLConnectionContext();
if(sslCxt != null) {
TSSLTransportParameters params = new TSSLTransportParameters(sslCxt.getSslProtocol(), sslCxt.getSslCipherSuites().toArray(new String[0]));
params.setTrustStore(sslCxt.getSslTruststore(), sslCxt.getSslTruststorePassword());
//thrift's SSL implementation does not allow you set the socket connect timeout, only read timeout
socket = TSSLTransportFactory.getClientSocket(getHost().getIpAddress(), getHost().getPort(), cpConfig.getSocketTimeout(), params);
} else {
socket = new TSocket(getHost().getIpAddress(), getHost().getPort(), cpConfig.getConnectTimeout());
}