added ClientConfig.connectionAttempts to provide an upper bound to connection attempts.