0

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?

1 Answers1

1

Two/more channels in one session.

The getInputStream implementation calls SftpFileSystem.getChannel(), which creates new channel or reuses existing idle channel.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992