Module org.newsclub.net.unix
Package org.newsclub.net.unix
Interface AFSocketAddressFromHostname<A extends AFSocketAddress>
- Type Parameters:
A- The supported address type.
- 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 Summary
Modifier and TypeMethodDescriptionaddressFromHost(String host, int port) Translates a "host" string (and port) to anAFSocketAddress.default booleanisHostnameSupported(String host) Checks whether the given hostname is supported by this socket factory.
-
Method Details
-
addressFromHost
Translates a "host" string (and port) to anAFSocketAddress.- Parameters:
host- The hostnameport- The port, or 0.- Returns:
- The
AFSocketAddress - Throws:
SocketException- If there was a problem converting the hostnameNullPointerException- If host wasnull.
-
isHostnameSupported
Checks whether the given hostname is supported by this socket factory. If not, calls to createSocket will cause aSocketException.- Parameters:
host- The host to check.- Returns:
trueif supported.
-