Hello,
I'd like to perform multiple operations on an sftp server from multiple
threads simultaneously. All threads are servicing the same user connecting
to the same server sftp server.
Example:
- thread 1 performs a get() on file 1
- thread 2 performs a get() on file 2
- thread 3 performs a ls() on dir 3
- etc...
In my initial implementation I created a single session and a single
channel of type 'sftp', and shared it between all threads/requests. However
this doesn't seem to work - the InputStream used for get() can't be shared
across multiple requests and it gets closed when the second get() request
comes in.
What is the best practice for such a requirement? should each thread create
a new sftp channel and close it when done? do I also need a new session per
thread or can I still use a single user session and keep opening channels
from it on demand? is there a limit on how many sessions or channels can
(or should) be opened at the same time?
Appreciate your advice.
Alon.
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users