If I use SFTP Bind, should I keepAlive every session?

0 votes
asked Jun 21 by lanopk (900 points)

If I use SFTP Bind, should I keepAlive every session?
I have multiple Bind Sessions in one Connection.
Main Connection is doing KeepAlive in 10 seconds, but I wonder if each session should have KeepAlive.

Thank you.

Applies to: Rebex SFTP

1 Answer

0 votes
answered Jun 21 by Lukas Pokorny (101,990 points)

When using Sftp.Bind, the SFTP channel is created within the specified SSH session, so if you already call KeepAlive for that SshSession, there is no need to call it for every Sftp instance bound to that sessions. Calling KeepAlive for multiple Sftp instances sharing the same SSH session would have no benefit, but it would not cause any issues either because SSH packets send by KeepAlive are very short.

This said, it's usually not needed to bind multiple intances of Sftp to a single SshSession because even a single Sftp object supports multiple concurrent operations (unlike most other Rebex classes).

commented Jun 21 by lanopk (900 points)
Thank you.
We know Rebex supports asynchronous functions.
However, I'm making a program connected to the File System Driver, which uses a fully synchronized call.
Therefore, the task.Wait() should be used, which causes a deadlock.
This is because I don't have a good understanding of C#.

Thank you.
commented Jun 24 by Lukas Pokorny (101,990 points)
Actually, it's even possible to call multiple Sftp synchronous methods at the same from different threads.
...