I see no a-priori reason why one should not be able to run multiple SCP
upload/downloads over a single session:

try (ClientSession session = client.connect(...)
            ,verify(...timeout...)
            .getSession()) {

        session.addPassword(...) / addKey(...);
        session.auth().verify(...timeout...);

        ScpClient client = ScpClientFactory.createClient(session);
        ...spawn threads that download/upload...
        ....wait for threads to terminate (e.g. via an
ExecutorCompletionService)
}

There are however inherent limitations:

* Number of concurrent I/O threads on the client side
* Ditto on the server side
* Concurrent number of open file handles on client/server side
* Etc...

Some of values can be configured to match your needs (e.g. concurrent I/O
threads on the client side) - most cannot since they are O/S defaults.

You mentioned 100 concurrent files - which seems very excessive by any
standards. Perhaps you can settle on some kind of queue with up to 10-20
concurrent transfers at any time.

Reply via email to