0 votes
by (2.0k 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
by (148k 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).

by (2.0k 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.
by (148k points)
Actually, it's even possible to call multiple Sftp synchronous methods at the same from different threads.
...