[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting timeout for ssh_connect() only


Hi there

If I interpret the code right, there's a default timeout for ssh_connect() of 10 seconds as long as no user timeouts are set (and the session is blocking).

IMHO the timeout for opening the connection should not be coupled to the general polling timeout...
It would be a nice feature to have an option for ssh_connect() only, e.g SSH_OPTIONS_CONNECT_TIMEOUT. Or through a second parameter: ssh_connect(session, timeout).

Will this work as intended?

 int conn_timeout = 5; // custom connect timeout
 ssh_options_set(session, SSH_OPTIONS_TIMEOUT, conn_timeout);
 ret = ssh_connect(session);
 /* handle ret */
 ssh_options_set(session, SSH_OPTIONS_TIMEOUT, 0);

Does SSH_OPTIONS_TIMEOUT 0 set the default behavior?

Cheers
Till

Follow-Ups:
Re: Setting timeout for ssh_connect() onlyJakub Jelen <jjelen@xxxxxxxxxx>
Re: Setting timeout for ssh_connect() onlyg4-lisz@xxxxxxxxxxxx
Archive administrator: postmaster@lists.cynapses.org