Hi ymnk,

If I use JSch to open a reverse tunnel (session.setPortForwardingR) to a Windows VNC server, when I connect the VNC client to the forwarded port, the performance is very choppy. The same setup with a normal forward (session.setPortForwardingL) performs fine. When I use the OpenSSH command line client to setup the same reverse tunnel (ssh -R5900:localhost:5900 ...), the performance is also very good.

After investigating this issue, I discovered that the performance was good with the native SSH client because it was allocating a pseudo terminal (pty) to display the remote command shell. When I instructed the SSH client NOT to allocate a pty (ssh -N -R5900:localhost:5900 ...), I was able to duplicate the same poor performance I saw with JSch. Apparently, if there is no pty assigned to the remote session, the SSH server will buffer and "chunk" the data over all reverse forwards on that session. To test this theory, I hacked up my application with the following code prior to setting up the reverse forward:

   Channel hackChannel = session.openChannel( "shell" );
   hackChannel.setInputStream( new ByteArrayInputStream( new byte[ 100
   ] ) );
   hackChannel.setOutputStream( System.out );
   hackChannel.connect( );
   Thread.sleep( 2000 );
   hackChannel.disconnect( );

Lo and behold, my VNC performance was then excellent. Obviously, this is not an acceptable solution for my application. I am wondering if you have any ideas on a cleaner, more permanent solution. Do you know if there is a way I can programmatically instruct the SSH server to disable buffering over these channels?

I appreciate any input you would have on this issue.

Thanks.
 - Scott Smith

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to