Class SocketClient

  • Direct Known Subclasses:
    SSHClient

    public abstract class SocketClient
    extends java.lang.Object
    • Method Summary

      Modifier and Type Method Description
      void connect​(java.lang.String hostname)  
      void connect​(java.lang.String hostname, int port)  
      void connect​(java.lang.String hostname, int port, java.net.InetAddress localAddr, int localPort)  
      void connect​(java.lang.String hostname, int port, java.net.Proxy proxy)
      Deprecated.
      This method will be removed after v0.12.0.
      void connect​(java.lang.String hostname, java.net.Proxy proxy)
      Deprecated.
      This method will be removed after v0.12.0.
      void connect​(java.net.InetAddress host)  
      void connect​(java.net.InetAddress host, int port)  
      void connect​(java.net.InetAddress host, int port, java.net.InetAddress localAddr, int localPort)  
      void connect​(java.net.InetAddress host, int port, java.net.Proxy proxy)
      Deprecated.
      This method will be removed after v0.12.0.
      void connect​(java.net.InetAddress host, java.net.Proxy proxy)
      Deprecated.
      This method will be removed after v0.12.0.
      void connectVia​(Channel channel, java.lang.String hostname, int port)  
      void connectVia​(DirectConnection directConnection)
      Connect to a remote address via a direct TCP/IP connection from the server.
      void disconnect()  
      int getConnectTimeout()  
      java.net.InetAddress getLocalAddress()  
      int getLocalPort()  
      java.net.InetAddress getRemoteAddress()  
      java.lang.String getRemoteHostname()  
      int getRemotePort()  
      java.net.Socket getSocket()  
      javax.net.SocketFactory getSocketFactory()  
      int getTimeout()  
      boolean isConnected()  
      protected java.net.InetSocketAddress makeInetSocketAddress​(java.lang.String hostname, int port)  
      void setConnectTimeout​(int connectTimeout)  
      void setSocketFactory​(javax.net.SocketFactory factory)  
      void setTimeout​(int timeout)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • makeInetSocketAddress

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

        @Deprecated
        public void connect​(java.lang.String hostname,
                            java.net.Proxy proxy)
                     throws java.io.IOException
        Deprecated.
        This method will be removed after v0.12.0. If you want to connect via a proxy, you can do this by injecting a SocketFactory into the SocketClient. The SocketFactory should create sockets using the Socket(java.net.Proxy) constructor.
        Connect to a host via a proxy.
        Parameters:
        hostname - The host name to connect to.
        proxy - The proxy to connect via.
        Throws:
        java.io.IOException
      • connect

        @Deprecated
        public void connect​(java.lang.String hostname,
                            int port,
                            java.net.Proxy proxy)
                     throws java.io.IOException
        Deprecated.
        This method will be removed after v0.12.0. If you want to connect via a proxy, you can do this by injecting a SocketFactory into the SocketClient. The SocketFactory should create sockets using the Socket(java.net.Proxy) constructor.
        Connect to a host via a proxy.
        Parameters:
        hostname - The host name to connect to.
        port - The port to connect to.
        proxy - The proxy to connect via.
        Throws:
        java.io.IOException
      • connect

        @Deprecated
        public void connect​(java.net.InetAddress host,
                            java.net.Proxy proxy)
                     throws java.io.IOException
        Deprecated.
        This method will be removed after v0.12.0. If you want to connect via a proxy, you can do this by injecting a SocketFactory into the SocketClient. The SocketFactory should create sockets using the Socket(java.net.Proxy) constructor.
        Connect to a host via a proxy.
        Parameters:
        host - The host address to connect to.
        proxy - The proxy to connect via.
        Throws:
        java.io.IOException
      • connect

        @Deprecated
        public void connect​(java.net.InetAddress host,
                            int port,
                            java.net.Proxy proxy)
                     throws java.io.IOException
        Deprecated.
        This method will be removed after v0.12.0. If you want to connect via a proxy, you can do this by injecting a SocketFactory into the SocketClient. The SocketFactory should create sockets using the Socket(java.net.Proxy) constructor.
        Connect to a host via a proxy.
        Parameters:
        host - The host address to connect to.
        port - The port to connect to.
        proxy - The proxy to connect via.
        Throws:
        java.io.IOException
      • 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()