Interface AFSocketAddressFromHostname<A extends AFSocketAddress>

All Known Implementing Classes:
AFSocketFactory, AFSocketFactory.FixedAddressSocketFactory, AFUNIXSocketFactory, AFUNIXSocketFactory.FactoryArg, AFUNIXSocketFactory.SystemProperty, AFUNIXSocketFactory.URIScheme

public interface AFSocketAddressFromHostname<A extends AFSocketAddress>
Helps converting an internet "hostname" to an AFSocketAddress.
Author:
Christian Kohlschütter
  • Method Details

    • addressFromHost

      SocketAddress addressFromHost(String host, int port) throws SocketException
      Translates a "host" string (and port) to an AFSocketAddress.
      Parameters:
      host - The hostname
      port - The port, or 0.
      Returns:
      The AFSocketAddress
      Throws:
      SocketException - If there was a problem converting the hostname
      NullPointerException - If host was null.
    • isHostnameSupported

      default boolean isHostnameSupported(String host)
      Checks whether the given hostname is supported by this socket factory. If not, calls to createSocket will cause a SocketException.
      Parameters:
      host - The host to check.
      Returns:
      true if supported.