Re: [JSch-users] Concurrency with JSch

2014-11-18 Thread Bogdan SOLGA
Hello, Guillaume! I had the same issues with JSCH, and still haven't figured out a proper way to handle the thread safety, besides executing in multiple threads and using a retry mechanism. I would also be interested to find a better way, though. Kind regards, Bogdan On Mon, Nov 17, 2014 at 6:

Re: [JSch-users] Concurrency with JSch

2014-11-17 Thread Lahiru Gunathilake
Hi guillaume, I was able tohandle it in my code level by synchronizing the code. Everything works fine, I share sessions but synchronized the methods. Lahiru On Mon, Nov 17, 2014 at 11:22 AM, guillaume cornet < cornet.guillaume.pie...@gmail.com> wrote: > Hi Lahiru ! > > > I'm creating many Sftp

Re: [JSch-users] Concurrency with JSch

2014-11-17 Thread guillaume cornet
Hi Lahiru ! I'm creating many SftpChannel in multiple Session and I'm facing the same issue (e.g. 'Packet corrupt' or 'connection is closed by foreign host'). In order to solve this issue, I've introduce an retry mechanism in my code, so that a new Session is created an openend when such error a

Re: [JSch-users] Concurrency with JSch

2014-10-07 Thread Lahiru Gunathilake
Hi Users, And when I remove the threadpool an still submit a very large load I can see I am getting the following error intermittently, com.jcraft.jsch.JSchException: Packet corrupt at com.jcraft.jsch.Session.start_discard(Session.java:1049) at com.jcraft.jsch.Session.read(Sess

[JSch-users] Concurrency with JSch

2014-10-07 Thread Lahiru Gunathilake
Hi All, I have extended the JCraft library to authenticate my servers with a token and everything works fine when I use in the serial mode. But when I moved to a thread pool and try to share the JCraftSession and try to create multiple channels in large number of threads (I have already increased