static int thread_running = 0;
static char *filter_uuid;
static char *logfilter;
+static int timeout = 0;
+static int connect_timeout = 0;
#ifndef WIN32
static EditLine *el;
static History *myhistory;
" -d, --debug=level Debug Level (0 - 7)\n"
" -b, --batchmode Batch mode\n"
" -t, --timeout Timeout for API commands (in miliseconds)\n"
+ " -T, --connect-timeout Timeout for socket connection (in miliseconds)\n"
" -n, --no-color Disable color\n\n";
static int usage(char *name){
profiles[pcount-1].console_fnkeys[i - 1] = strdup(val);
}
}
+ } else if (!strcasecmp(var, "timeout")) {
+ timeout = atoi(val);
+ } else if (!strcasecmp(var, "connect-timeout")) {
+ connect_timeout = atoi(val);
}
}
esl_config_close_file(&cfg);
{"interrupt", 0, 0, 'i'},
{"reconnect", 0, 0, 'R'},
{"timeout", 1, 0, 't'},
+ {"connect-timeout", 1, 0, 'T'},
{0, 0, 0, 0}
};
char temp_host[128];
int argv_log_uuid = 0;
int argv_quiet = 0;
int argv_batch = 0;
- int loops = 2, reconnect = 0, timeout = 0;
+ int loops = 2, reconnect = 0;
char *ccheck;
#ifdef WIN32
esl_global_set_default_logger(6); /* default debug level to 6 (info) */
for(;;) {
int option_index = 0;
- opt = getopt_long(argc, argv, "H:P:S:u:p:d:x:l:Ut:qrRhib?n", options, &option_index);
+ opt = getopt_long(argc, argv, "H:P:S:u:p:d:x:l:Ut:T:qrRhib?n", options, &option_index);
if (opt == -1) break;
switch (opt) {
case 'H':
case 't':
timeout = atoi(optarg);
break;
+ case 'T':
+ connect_timeout = atoi(optarg);
+ break;
case 'h':
case '?':
print_banner(stdout, is_color);
connected = 0;
while (--loops > 0) {
memset(&handle, 0, sizeof(handle));
- if (esl_connect(&handle, profile->host, profile->port, profile->user, profile->pass)) {
+ if (esl_connect_timeout(&handle, profile->host, profile->port, profile->user, profile->pass, connect_timeout)) {
esl_global_set_default_logger(7);
esl_log(ESL_LOG_ERROR, "Error Connecting [%s]\n", handle.err);
if (loops == 1) {