Class SocketClient

  • Direct Known Subclasses:
    SSHClient

    public abstract class SocketClient
    extends java.lang.Object
    • Field Detail

      • defaultPort

        private final int defaultPort
      • socket

        private java.net.Socket socket
      • input

        private java.io.InputStream input
      • output

        private java.io.OutputStream output
      • socketFactory

        private javax.net.SocketFactory socketFactory
      • DEFAULT_CONNECT_TIMEOUT

        private static final int DEFAULT_CONNECT_TIMEOUT
        See Also:
        Constant Field Values
      • connectTimeout

        private int connectTimeout
      • timeout

        private int timeout
      • hostname

        private java.lang.String hostname
      • port

        private int port
      • tunneled

        private boolean tunneled
    • Constructor Detail

      • SocketClient

        SocketClient​(int defaultPort)
    • Method Detail

      • makeInetSocketAddress

        protected java.net.InetSocketAddress makeInetSocketAddress​(java.lang.String hostname,
                                                                   int port)
      • connect

        public void connect​(java.lang.String hostname)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • connect

        public void connect​(java.lang.String hostname,
                            int port)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • connect

        public void connect​(java.lang.String hostname,
                            int port,
                            java.net.InetAddress localAddr,
                            int localPort)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • connectVia

        public void connectVia​(Channel channel,
                               java.lang.String hostname,
                               int port)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • connectVia

        public void connectVia​(DirectConnection directConnection)
                        throws java.io.IOException
        Connect to a remote address via a direct TCP/IP connection from the server.
        Throws:
        java.io.IOException
      • connect

        public void connect​(java.net.InetAddress host)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • connect

        public void connect​(java.net.InetAddress host,
                            int port)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • connect

        public void connect​(java.net.InetAddress host,
                            int port,
                            java.net.InetAddress localAddr,
                            int localPort)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • disconnect

        public void disconnect()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • isConnected

        public boolean isConnected()
      • getLocalPort

        public int getLocalPort()
      • getLocalAddress

        public java.net.InetAddress getLocalAddress()
      • getRemoteHostname

        public java.lang.String getRemoteHostname()
      • getRemotePort

        public int getRemotePort()
      • getRemoteAddress

        public java.net.InetAddress getRemoteAddress()
      • setSocketFactory

        public void setSocketFactory​(javax.net.SocketFactory factory)
      • getSocketFactory

        public javax.net.SocketFactory getSocketFactory()
      • getConnectTimeout

        public int getConnectTimeout()
      • setConnectTimeout

        public void setConnectTimeout​(int connectTimeout)
      • getTimeout

        public int getTimeout()
      • setTimeout

        public void setTimeout​(int timeout)
      • getSocket

        public java.net.Socket getSocket()
      • getInputStream

        java.io.InputStream getInputStream()
      • getOutputStream

        java.io.OutputStream getOutputStream()
      • onConnect

        void onConnect()
                throws java.io.IOException
        Throws:
        java.io.IOException