config.setConnectionResponseTimeout(timeout);
config.setProcedureCallTimeout(timeout);
final Client client = ClientFactory.createClient(config);
// Use the port generated by LocalCluster if applicable
try {
client.createConnection(listener);
}
// retry once
catch (ConnectException e) {
listener = listeners.get(r.nextInt(listeners.size()));
client.createConnection(listener);