~ubuntu-branches/ubuntu/trusty/jsch/trusty

« back to all changes in this revision

Viewing changes to examples/StreamForwarding.java

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-01-06 10:50:04 UTC
  • mfrom: (1.5.2) (4.1.3 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20140106105004-7fyrf1i1o9fk6ul3
Tags: 0.1.50-1ubuntu1
* Resync with Debian unstable.
* Drop dependency on libjzlib-java for continued main inclusion. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
      System.out.println("System.{in,out} will be forwarded to "+
50
50
                         host+":"+port+".");
51
 
      Channel channel=session.openChannel("direct-tcpip");
52
 
      ((ChannelDirectTCPIP)channel).setInputStream(System.in);
53
 
      ((ChannelDirectTCPIP)channel).setOutputStream(System.out);
54
 
      ((ChannelDirectTCPIP)channel).setHost(host);
55
 
      ((ChannelDirectTCPIP)channel).setPort(port);
56
 
      channel.connect();
 
51
      Channel channel = session.getStreamForwarder(host, port);
 
52
      // InputStream in = channel.getInputStream();
 
53
      // OutpuStream out = channel.getOutputStream();
 
54
      channel.setInputStream(System.in);
 
55
      channel.setOutputStream(System.out);
 
56
      channel.connect(1000);
57
57
    }
58
58
    catch(Exception e){
59
59
      System.out.println(e);