[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Timeout not working with sftp_read
[Thread Prev] | [Thread Next]
- Subject: Timeout not working with sftp_read
- From: Makarand Pradhan <MakarandPradhan@xxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Wed, 18 Nov 2020 20:06:50 +0000
- To: "libssh@xxxxxxxxxx" <libssh@xxxxxxxxxx>
Hello All,
I'm noticing an issue with sftp_read and would highly appreciate advice.
If the link goes during sftp_read, sftp_read does not return. It stays stuck even when the session timeout is set to 10 seconds.
My code:
while (bytesToRead)
{
timeout = 10;
ssh_options_set(session, SSH_OPTIONS_TIMEOUT, &timeout);
len = sftp_read(remoteSftpFile, data, DATALEN);
if (len > 0)
{
I was expecting that when the session timeout is set, sftp_read should return with an ERR msg set on timeout.
Have tried experimenting with non blocking, sftp_async_read. But nothing seems to work.
I'm stuck here for quite some time now. Would appreciate any suggestions that can help me handle the link down scenario for sftp_read.
Kind rgds,
Makarand Pradhan
Senior Software Engineer.
iS5 Communications Inc.
5895 Ambler Dr,
Mississauga, Ontario
L4W 5B7
Main Line: +1-844-520-0588 Ext. 129
Direct Line: +1-289-724-2296
Cell: +1-226-501-5666
Fax:+1-289-401-5206
Email: makarandpradhan@xxxxxxxxxx
Website: www.iS5Com.com
Confidentiality Notice:
This message is intended only for the named recipients. This message may contain information that is confidential and/or exempt from disclosure under applicable law. Any dissemination or copying of this message by anyone other than a named recipient is strictly prohibited. If you are not a named recipient or an employee or agent responsible for delivering this message to a named recipient, please notify us immediately, and permanently destroy this message and any copies you may have. Warning: Email may not be secure unless properly encrypted.
| Re: Timeout not working with sftp_read | Jakub Jelen <jjelen@xxxxxxxxxx> |