Examples of IOStreamConnector


Examples of com.adito.agent.client.util.IOStreamConnector

    /* (non-Javadoc)
     * @see com.adito.vpn.base.VPNTunnel#start()
     */
    public void start() throws IOException {
        try {
            rx = new IOStreamConnector();
            rx.addListener(rxListener);
            rx.addListener(rxStreamListener);
            rx.connect(tunnel.getInputStream(), client.getOutputStream());

            tx = new IOStreamConnector();
            tx.addListener(txListener);
            tx.addListener(txStreamListener);
            tx.connect(client.getInputStream(), tunnel.getOutputStream());

            for (int i = 0; i < listeners.size(); i++)
View Full Code Here

Examples of com.maverick.multiplex.IOStreamConnector

  public void onChannelOpen(byte[] data) {
    lastData = System.currentTimeMillis();
    if (socket != null) {
      try {
        input = new IOStreamConnector(socket.getInputStream(), getOutputStream());
        output = new IOStreamConnector(getInputStream(), socket.getOutputStream());
      } catch (IOException ex) {
        close();
      }
    }
  }
View Full Code Here

Examples of com.maverick.multiplex.IOStreamConnector

  public void onChannelOpen(byte[] data) {
   
    if(socket!=null) {
      try {
        input = new IOStreamConnector(socket.getInputStream(),
            getOutputStream());
        output = new IOStreamConnector(getInputStream(),
            socket.getOutputStream());
      } catch(IOException ex) {
        close();
      }
      }
View Full Code Here

Examples of com.maverick.multiplex.IOStreamConnector

    }

    public void onChannelOpen(byte[] data) {
        if (incomingConnection != null) {
            try {
                input = new IOStreamConnector(getInputStream(), incomingConnection.getOutputStream());
                output = new IOStreamConnector(incomingConnection.getInputStream(), getOutputStream());
            } catch (IOException ex) {
                close();
            }
        }
    }
View Full Code Here

Examples of com.sshtools.j2ssh.io.IOStreamConnector

     * @throws IOException
     */
    public void bindInputStream(InputStream boundInputStream)
        throws IOException {
        this.boundInputStream = boundInputStream;
        this.ios = new IOStreamConnector();

        if (state.getValue() == ChannelState.CHANNEL_OPEN) {
            ios.setCloseInput(false);
            ios.setCloseOutput(false);
            ios.connect(boundInputStream, out);
View Full Code Here

Examples of com.sshtools.j2ssh.io.IOStreamConnector

        if(!session.requestPseudoTerminal("vt100", 80, 24, 0, 0, ""))
          System.out.println("Failed to allocate a pseudo terminal");
        if(session.startShell()) {
          InputStream in = session.getInputStream();
          OutputStream out = session.getOutputStream();
          IOStreamConnector input =
              new IOStreamConnector(System.in, session.getOutputStream());
          IOStreamConnector output =
              new IOStreamConnector(session.getInputStream(), System.out);
          output.getState().waitForState(IOStreamConnectorState.CLOSED);
        } else
          System.out.println("Failed to start the users shell");
        ssh.disconnect();
      }
      if (result == AuthenticationProtocolState.PARTIAL) {
View Full Code Here

Examples of com.sshtools.j2ssh.io.IOStreamConnector

        // The connection is authenticated we can now do some real work!
        SessionChannelClient session = ssh.openSessionChannel();
        if(!session.requestPseudoTerminal("vt100", 80, 24, 0, 0, ""))
          System.out.println("Failed to allocate a pseudo terminal");
        if(session.startShell()) {
          IOStreamConnector input =
              new IOStreamConnector(System.in, session.getOutputStream());
          IOStreamConnector output =
              new IOStreamConnector(session.getInputStream(), System.out);
          output.getState().waitForState(IOStreamConnectorState.CLOSED);
        }else
          System.out.println("Failed to start the users shell");
        ssh.disconnect();
      }
    }
View Full Code Here

Examples of com.sshtools.j2ssh.io.IOStreamConnector

        // The connection is authenticated we can now do some real work!
        SessionChannelClient session = ssh.openSessionChannel();
        if(!session.requestPseudoTerminal("vt100", 80, 24, 0, 0, ""))
          System.out.println("Failed to allocate a pseudo terminal");
        if (session.startShell()) {
          IOStreamConnector input =
              new IOStreamConnector();
          IOStreamConnector output =
              new IOStreamConnector();
          IOStreamConnector error =
              new IOStreamConnector();
          output.setCloseOutput(false);
          input.setCloseInput(false);
          error.setCloseOutput(false);
          input.connect(System.in, session.getOutputStream());
          output.connect(session.getInputStream(), System.out);
          error.connect(session.getStderrInputStream(), System.out);
          session.getState().waitForState(ChannelState.CHANNEL_CLOSED);
        }else
          System.out.println("Failed to start the users shell");
        ssh.disconnect();
      }
View Full Code Here

Examples of com.sshtools.j2ssh.io.IOStreamConnector

    {
      // The connection is authenticated we can now do some real work!
      SessionChannelClient session = ssh.openSessionChannel();

      if ( session.executeCommand(cmd)){
        IOStreamConnector output = new IOStreamConnector();
        java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream();
        output.connect(session.getInputStream(), bos );
        session.getState().waitForState(ChannelState.CHANNEL_CLOSED);
        theOutput = bos.toString();
        //System.out.println();
        resultCommand=true;
      }
View Full Code Here

Examples of com.sshtools.j2ssh.io.IOStreamConnector

    {
      // The connection is authenticated we can now do some real work!
      session = ssh.openSessionChannel();

      if ( session.executeCommand(cmd)){
        IOStreamConnector output = new IOStreamConnector();
        java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream();
        output.connect(session.getInputStream(), bos );
        session.getState().waitForState(ChannelState.CHANNEL_CLOSED);
        theOutput = bos.toString();
        //System.out.println();
      }
      //else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.