Package com.sshtools.j2ssh.forwarding

Examples of com.sshtools.j2ssh.forwarding.ForwardingSocketChannel


            ForwardingConfiguration config = getLocalForwardingByAddress(originatingHost,
                    originatingPort);
            Socket socket = new Socket(hostToConnect, portToConnect);

            // Create the channel adding it to the active channels
            ForwardingSocketChannel channel = config.createForwardingSocketChannel(channelType,
                    hostToConnect, portToConnect, originatingHost,
                    originatingPort);
            channel.bindSocket(socket);

            return channel;
        } catch (ForwardingConfigurationException fce) {
            throw new InvalidChannelException(
                "No valid forwarding configuration was available for the request");
View Full Code Here


        public ForwardingSocketChannel createChannel(String hostToConnect,
            int portToConnect, Socket socket)
            throws ForwardingConfigurationException {
            try {
                ForwardingSocketChannel channel = createForwardingSocketChannel(ForwardingSocketChannel.REMOTE_FORWARDING_CHANNEL,
                        hostToConnect, portToConnect,
                       
                    /*( (InetSocketAddress) socket.getRemoteSocketAddress()).getAddress()
          .getHostAddress(),
          ( (InetSocketAddress) socket.getRemoteSocketAddress())
          .getPort()*/
                    socket.getInetAddress().getHostAddress(), socket.getPort());
                channel.bindSocket(socket);

                return channel;
            } catch (IOException ex) {
                throw new ForwardingConfigurationException(ex.getMessage());
            }
View Full Code Here

            ForwardingConfiguration config = getLocalForwardingByAddress(originatingHost,
                    originatingPort);
            Socket socket = new Socket(hostToConnect, portToConnect);

            // Create the channel adding it to the active channels
            ForwardingSocketChannel channel = config.createForwardingSocketChannel(channelType,
                    hostToConnect, portToConnect, originatingHost,
                    originatingPort);
            channel.bindSocket(socket);

            return channel;
        } catch (ForwardingConfigurationException fce) {
            throw new InvalidChannelException(
                "No valid forwarding configuration was available for the request");
View Full Code Here

        public ForwardingSocketChannel createChannel(String hostToConnect,
            int portToConnect, Socket socket)
            throws ForwardingConfigurationException {
            try {
                ForwardingSocketChannel channel = createForwardingSocketChannel(ForwardingSocketChannel.REMOTE_FORWARDING_CHANNEL,
                        hostToConnect, portToConnect,
                       
                    /*( (InetSocketAddress) socket.getRemoteSocketAddress()).getAddress()
          .getHostAddress(),
          ( (InetSocketAddress) socket.getRemoteSocketAddress())
          .getPort()*/
                    socket.getInetAddress().getHostAddress(), socket.getPort());
                channel.bindSocket(socket);

                return channel;
            } catch (IOException ex) {
                throw new ForwardingConfigurationException(ex.getMessage());
            }
View Full Code Here

TOP

Related Classes of com.sshtools.j2ssh.forwarding.ForwardingSocketChannel

Copyright © 2018 www.massapicom. 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.