[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
which LibSSH API notifies Client if Server gets Disconnected.
[Thread Prev] | [Thread Next]
- Subject: which LibSSH API notifies Client if Server gets Disconnected.
- From: "V Sidnal, Nagraju" <nagraju.sidnal@xxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 17 Feb 2020 13:43:18 +0000
- To: "libssh@xxxxxxxxxx" <libssh@xxxxxxxxxx>
Dear Team, We are using below logic to execute command on SSH Server. int rc = ssh_connect(my_ssh_session); rc = ssh_pki_import_privkey_file("id_rsa", NULL, NULL, NULL, &pkey); rc = ssh_userauth_publickey(my_ssh_session, NULL, pkey); channel = ssh_channel_new(my_ssh_session); rc = ssh_channel_open_session(channel); rc = ssh_channel_request_exec(channel, "lscommand"); //after this we reading the result & closing the channel. We are keeping session saved in our class for next command execution/call iteration, so that we don't need to create connection again. However For next call, every time we are creating new channel for executing the command, as we cannot use same channel. We are running some logic internally, which keeps checking ssh_is_connected() , to keep track of connection status with Server. However this logic looks heavy. Could you please help me with the API of libssh - callback API's of libssh, using which I don't need to check ssh_is_connected(). I'm unable to figure out a Call back Api , using which Client will get notified whenever server gets disconnected. Thanks in advance. Regards, Nagraju
Archive administrator: postmaster@lists.cynapses.org