[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Switching between blocking and non-blocking mode
[Thread Prev] | [Thread Next]
- Subject: Switching between blocking and non-blocking mode
- From: James Wrigley <james@xxxxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Sat, 22 Mar 2025 16:43:39 +0100
- To: Libssh mailing list <libssh@xxxxxxxxxx>
Hi there, I nominally use LibSSH in non-blocking mode, however in some cases I want to perform SFTP operations. Because the SFTP API does not support non-blocking mode right now my approach is to switch the session to blocking mode, do the SFTP operation, and then switch back to non-blocking mode. In my application I've noticed that this can sometimes lead to sftp_new() just failing for some reason. I haven't started debugging this properly, but my initial question is basically, is it safe to switch a session from blocking to non-blocking mode and back like this? Or is a session meant to be in a single mode for its entire lifetime? For context I'm using LibSSH in Julia, hence the session usually needs to be in non-blocking mode to play nicely with Julia's event loop. Thanks, James
Re: Switching between blocking and non-blocking mode | Jakub Jelen <jjelen@xxxxxxxxxx> |