You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Israel Malachi <is...@ellipsis.co.il> on 2014/11/11 15:24:48 UTC

(VFS) underlying usage of Jsch Sessions/Channels

Hello all

Please consider the following code:

    FileSystemManager fsManager = VFS.getManager();
    FileObject sftpDir =
fsManager.resolveFile("sftp://username:password@host/pub/downloads/");
    FileObject child1 =  sftpDir.getChild("child1.data");
    FileObject child2 =  sftpDir.getChild("child2.data");
    InputStream s1 = child1.getContent().getInputStream();
    InputStream s2 = child2.getContent().getInputStream();

On the Jsch underlying level, were two separated sessions created, or one
session and two channels?

[VFS] Re: underlying usage of Jsch Sessions/Channels

Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
Hello,

If I read the code correct, it will create a channel for each
concurrent stream. When the channel is no longer used it will close
all, besides the last channel. This allows sequentiel operations to work
without re-establishing a channel.

New channels seem to be established within a existing session only (so
no parallel tcp seems to be used):

https://github.com/apache/commons-vfs/blob/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java#L111

Gruss
Bernd

Am Tue, 11 Nov 2014 16:24:48 +0200 schrieb Israel
Malachi <is...@ellipsis.co.il>:

> Hello all
> 
> Please consider the following code:
> 
>     FileSystemManager fsManager = VFS.getManager();
>     FileObject sftpDir =
> fsManager.resolveFile("sftp://username:password@host/pub/downloads/");
>     FileObject child1 =  sftpDir.getChild("child1.data");
>     FileObject child2 =  sftpDir.getChild("child2.data");
>     InputStream s1 = child1.getContent().getInputStream();
>     InputStream s2 = child2.getContent().getInputStream();
> 
> On the Jsch underlying level, were two separated sessions created, or
> one session and two channels?
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org