void closeAll() { closeChannel(); if (channel == null) { return; } try { Session session = channel.getSession(); session.disconnect(); } catch (JSchException e) { } }
public void sendSignal(String signal) throws Exception { RequestSignal request=new RequestSignal(); request.setSignal(signal); request.request(getSession(), this); }
public void sendSignal(String signal) throws Exception { RequestSignal request=new RequestSignal(); request.setSignal(signal); request.request(getSession(), this); }
public void sendSignal(String signal) throws Exception { RequestSignal request=new RequestSignal(); request.setSignal(signal); request.request(getSession(), this); }
public void sendSignal(String signal) throws Exception { RequestSignal request = new RequestSignal(); request.setSignal(signal); request.request(getSession(), this); }
/** * sends a signal to the process at the other side. * * This is only useful for interactive channels. * @param signal the signal name, without the "SIG" prefix. * @see <a href="http://tools.ietf.org/html/rfc4254#section-6.9">RFC 4254, * Section 6.9. Signals</a> */ public void sendSignal(String signal) throws Exception { RequestSignal request=new RequestSignal(); request.setSignal(signal); request.request(getSession(), this); }
public InputStream getExtInputStream() throws IOException { int max_input_buffer_size = 32 * 1024; try { max_input_buffer_size = Integer.parseInt(getSession().getConfig("max_input_buffer_size")); } catch (Exception e) { } PipedInputStream in = new MyPipedInputStream( 32 * 1024, // this value should be customizable. max_input_buffer_size ); boolean resizable = 32 * 1024 < max_input_buffer_size; io.setExtOutputStream(new PassiveOutputStream(in, resizable), false); return in; }
public InputStream getInputStream() throws IOException { int max_input_buffer_size = 32 * 1024; try { max_input_buffer_size = Integer.parseInt(getSession().getConfig("max_input_buffer_size")); } catch (Exception e) { } PipedInputStream in = new MyPipedInputStream( 32 * 1024, // this value should be customizable. max_input_buffer_size ); boolean resizable = 32 * 1024 < max_input_buffer_size; io.setOutputStream(new PassiveOutputStream(in, resizable), false); return in; }
public InputStream getExtInputStream() throws IOException { int max_input_buffer_size = 32*1024; try { max_input_buffer_size = Integer.parseInt(getSession().getConfig("max_input_buffer_size")); } catch(Exception e){} PipedInputStream in = new MyPipedInputStream( 32*1024, // this value should be customizable. max_input_buffer_size ); boolean resizable = 32*1024<max_input_buffer_size; io.setExtOutputStream(new PassiveOutputStream(in, resizable), false); return in; } public OutputStream getOutputStream() throws IOException {
public InputStream getExtInputStream() throws IOException { int max_input_buffer_size = 32*1024; try { max_input_buffer_size = Integer.parseInt(getSession().getConfig("max_input_buffer_size")); } catch(Exception e){} PipedInputStream in = new MyPipedInputStream( 32*1024, // this value should be customizable. max_input_buffer_size ); boolean resizable = 32*1024<max_input_buffer_size; io.setExtOutputStream(new PassiveOutputStream(in, resizable), false); return in; } public OutputStream getOutputStream() throws IOException {
protected void sendOpenFailure(int reasoncode){ try{ Buffer buf=new Buffer(100); Packet packet=new Packet(buf); packet.reset(); buf.putByte((byte)SSH_MSG_CHANNEL_OPEN_FAILURE); buf.putInt(getRecipient()); buf.putInt(reasoncode); buf.putString("open failed".getBytes()); buf.putString("".getBytes()); getSession().write(packet); } catch(Exception e){ } } }
void close(){ //System.err.println("close!!!!"); if(close)return; close=true; eof_local=eof_remote=true; try{ Buffer buf=new Buffer(100); Packet packet=new Packet(buf); packet.reset(); buf.putByte((byte)Session.SSH_MSG_CHANNEL_CLOSE); buf.putInt(getRecipient()); getSession().write(packet); } catch(Exception e){ //e.printStackTrace(); } } public boolean isClosed(){
protected void sendOpenConfirmation() throws Exception{ Buffer buf=new Buffer(100); Packet packet=new Packet(buf); packet.reset(); buf.putByte((byte)SSH_MSG_CHANNEL_OPEN_CONFIRMATION); buf.putInt(getRecipient()); buf.putInt(id); buf.putInt(lwsize); buf.putInt(lmpsize); getSession().write(packet); }
protected void sendOpenConfirmation() throws Exception{ Buffer buf=new Buffer(100); Packet packet=new Packet(buf); packet.reset(); buf.putByte((byte)SSH_MSG_CHANNEL_OPEN_CONFIRMATION); buf.putInt(getRecipient()); buf.putInt(id); buf.putInt(lwsize); buf.putInt(lmpsize); getSession().write(packet); }
protected void sendOpenConfirmation() throws Exception{ Buffer buf=new Buffer(100); Packet packet=new Packet(buf); packet.reset(); buf.putByte((byte)SSH_MSG_CHANNEL_OPEN_CONFIRMATION); buf.putInt(getRecipient()); buf.putInt(id); buf.putInt(lwsize); buf.putInt(lmpsize); getSession().write(packet); }
protected void sendOpenConfirmation() throws Exception { Buffer buf = new Buffer(100); Packet packet = new Packet(buf); packet.reset(); buf.putByte((byte) SSH_MSG_CHANNEL_OPEN_CONFIRMATION); buf.putInt(getRecipient()); buf.putInt(id); buf.putInt(lwsize); buf.putInt(lmpsize); getSession().write(packet); }
/** * sends a message confirming the opening of the channel. */ protected void sendOpenConfirmation() throws Exception{ Buffer buf=new Buffer(100); Packet packet=new Packet(buf); packet.reset(); buf.putByte((byte)SSH_MSG_CHANNEL_OPEN_CONFIRMATION); buf.putInt(getRecipient()); buf.putInt(id); buf.putInt(lwsize); buf.putInt(lmpsize); getSession().write(packet); }
protected void sendOpenFailure(int reasoncode) { try { Buffer buf = new Buffer(100); Packet packet = new Packet(buf); packet.reset(); buf.putByte((byte) SSH_MSG_CHANNEL_OPEN_FAILURE); buf.putInt(getRecipient()); buf.putInt(reasoncode); buf.putString(Util.str2byte("open failed")); buf.putString(Util.empty); getSession().write(packet); } catch (Exception e) { } }
protected void sendOpenFailure(int reasoncode){ try{ Buffer buf=new Buffer(100); Packet packet=new Packet(buf); packet.reset(); buf.putByte((byte)SSH_MSG_CHANNEL_OPEN_FAILURE); buf.putInt(getRecipient()); buf.putInt(reasoncode); buf.putString(Util.str2byte("open failed")); buf.putString(Util.empty); getSession().write(packet); } catch(Exception e){ } }
protected void sendOpenFailure(int reasoncode){ try{ Buffer buf=new Buffer(100); Packet packet=new Packet(buf); packet.reset(); buf.putByte((byte)SSH_MSG_CHANNEL_OPEN_FAILURE); buf.putInt(getRecipient()); buf.putInt(reasoncode); buf.putString(Util.str2byte("open failed")); buf.putString(Util.empty); getSession().write(packet); } catch(Exception e){ } }