[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Need Help Regarding::SSH blocking and Non-Blocking Mode
[Thread Prev] | [Thread Next]
- Subject: Need Help Regarding::SSH blocking and Non-Blocking Mode
- From: "V Sidnal, Nagraju" <nagraju.sidnal@xxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 5 Apr 2021 10:28:42 +0000
- To: "libssh@xxxxxxxxxx" <libssh@xxxxxxxxxx>
Hi All, When I'm creating a session, by default it create blocking session. If I use same blocking session to call SSH_CONNECT(SESSION), with timeout of 30 Seconds, For Invalid IP address it gets return after 30 seconds. When I set this to nonblocking by using ssh_set_blocking(SESSION,0) , If now, I do SSH_CONNECT(SESSION), it returns immediately with SSH_AGAIN. It means in nonblocking mode I need to try SSH_CONNECT(SESSION) repeatedly, until my expected timeout value or return SSH_OK, example in my case for 30 seconds. Apart from above observation, What is the impact of blocking and non-blocking mode? Which one is recommended. Which one to use in which scenarios. Note: In case of blocking mode if I do ssh_connect(session) on invalid Ip, cpu utilization going high around 20-30 % for some time. Regards, Nagraju
Re: Need Help Regarding::SSH blocking and Non-Blocking Mode | Jakub Jelen <jjelen@xxxxxxxxxx> |