Hi, guys, I developed a proxy application, by which users can telnet to it and 
send a "connect to xxx" command to connect to a ssh server. I use JSch as my 
ssh client:
    JSch jsch = new JSch();
    Session session = jsch.getSession(username, ip, 22);
    Channel channel = session.openChannel("shell");
    InputStream serverInputStream = channel.getInputStream();
    OutputStream serverOutputStream = channel.getOutputStream();
    MyReader myReader = new MyReader(userOutputStream, serverInputStream);
    new Thread(myReader).start();
    MyWriterThread myWriter = new MyWriter(userInputStream, serverOutputStream);
    new Thread(myWriter).start();
then deal with input and output respectively in these two new threads. But the 
server performance dropped rapidly with the increase of user amount for too 
many concurrent threads. So I want to use java.nio.channels.Selector and 
SocketChannel to decrease thread amount. However I can't find a way to connect 
input/output stream with Selector and SocketChannel. Does the ssh client of 
JSch support Java NIO?


Thanks a lot!

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to