Top Description Methods
org.newsclub.net.unix

public Interface AFSocketAddressFromHostname<A extends AFSocketAddress>

Known Direct Implementers
org.newsclub.net.unix.AFSocketFactory
Type Parameters
<A>
The supported address type.
Imports
java.net.SocketAddress, .SocketException

Helps converting an internet "hostname" to an AFSocketAddress.
Author
Christian Kohlschütter

Method Summary

Modifier and TypeMethod and Description
public SocketAddress

Returns:

The AFSocketAddress
addressFromHost
(String
The hostname
host
,
int
The port, or 0.
port
)

Translates a "host" string (and port) to an AFSocketAddress.

public default boolean

Returns:

true if supported.
isHostnameSupported
(String
The host to check.
host
)

Checks whether the given hostname is supported by this socket factory.

Method Detail

addressFromHostback to summary
public SocketAddress addressFromHost(String host, int port) throws SocketException

Translates a "host" string (and port) to an AFSocketAddress.

Parameters
host:String

The hostname

port:int

The port, or 0.

Returns:SocketAddress

The AFSocketAddress

Exceptions
SocketException:
If there was a problem converting the hostname
NullPointerException:
If host was null.
isHostnameSupportedback to summary
public 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:String

The host to check.

Returns:boolean

true if supported.