Class SocketAddress

    • Constructor Detail

      • SocketAddress

        public SocketAddress​(SocketAddress delegate)
      • SocketAddress

        public SocketAddress​(Object delegate)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • inetSocketAddress

        public static SocketAddress inetSocketAddress​(int port,
                                                      String host)
        Create a inet socket address, host must be non null and port must be between 0 and 65536.
        The host string can be an host name or an host address.
        No name resolution will be attempted.
        Parameters:
        port - the port
        host - the host
        Returns:
        the created socket address
      • domainSocketAddress

        public static SocketAddress domainSocketAddress​(String path)
        Create a domain socket address from a path.
        Parameters:
        path - the address path
        Returns:
        the created socket address
      • host

        public String host()
        Returns the host name when available or the IP address in string representation.
        Domain socket address returns null.
        Returns:
        the host address
      • hostName

        public String hostName()
        Returns the host name when available or null
        Domain socket address returns null.
        Returns:
        the host name
      • hostAddress

        public String hostAddress()
        Returns the host IP address when available or null as a String.
        Domain socket address returns null.
        Returns:
        the host address
      • port

        public int port()
        Returns:
        the address port or -1 for a domain socket
      • path

        public String path()
        Returns:
        the domain socket path or null for a inet socket address.
      • isInetSocket

        public boolean isInetSocket()
        Returns:
        true for an inet socket address
      • isDomainSocket

        public boolean isDomainSocket()
        Returns:
        true for an domain socket address
      • inetSocketAddress

        public static SocketAddress inetSocketAddress​(InetSocketAddress address)
        Create a inet socket address from a Java .
        No name resolution will be attempted.
        Parameters:
        address - the address
        Returns:
        the created socket address