Top Description Fields Constructors Methods
org.newsclub.net.unix

public final Class AFUNIXSocketAddress

extends AFSocketAddress
Class Inheritance
Annotations
@SuppressWarnings:PMD.ShortMethodName
Imports
java.io.File, .FileNotFoundException, .IOException, java.net.InetAddress, .InetSocketAddress, .SocketAddress, .SocketException, .URI, .URISyntaxException, java.nio.ByteBuffer, java.nio.charset.Charset, .StandardCharsets, java.nio.file.Path, java.util.Arrays, .HashSet, .Locale, .Objects, .Set, org.eclipse.jdt.annotation.NonNull, org.newsclub.net.unix.pool.ObjectPool.Lease

Describes an InetSocketAddress that actually uses AF_UNIX sockets instead of AF_INET. The ability to specify a port number is not specified by AF_UNIX sockets, but we need it sometimes, for example for RMI-over-AF_UNIX.
Author
Christian Kohlschütter

Field Summary

Modifier and TypeField and Description
private static final Charset
pack-priv static final AFAddressFamily<@NonNull AFUNIXSocketAddress>
private static final long
Inherited from org.newsclub.net.unix.AFSocketAddress:
INTERNAL_DUMMY_BINDINTERNAL_DUMMY_CONNECTINTERNAL_DUMMY_DONT_CONNECTSOCKETADDRESS_BUFFER_TL

Constructor Summary

AccessConstructor and Description
private
AFUNIXSocketAddress(int port, final byte[] socketAddress, ObjectPool.Lease<ByteBuffer> nativeAddress)

public
AFUNIXSocketAddress(File
The socket to connect to.
socketFile
)
Deprecated Use of(File) instead.

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given file and port.

public
AFUNIXSocketAddress(File
The socket to connect to.
socketFile
,
int
The port associated with this socket, or 0 when no port should be assigned.
port
)
Deprecated Use of(File, int) instead.

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given file.

Method Summary

Modifier and TypeMethod and Description
public static Charset

Returns:

The charset.
addressCharset
()

Returns the Charset used to encode/decode AFUNIXSocketAddresses.

public static AFAddressFamily<AFUNIXSocketAddress>

Returns:

The address family instance.
addressFamily
()

Returns the corresponding AFAddressFamily.

public File
getFile()

Implements abstract org.newsclub.net.unix.AFSocketAddress.getFile.

Returns the File corresponding with this address, if possible.

public String

Returns:

The path.
getPath
()

Returns the path to the UNIX domain socket, as a human-readable string using the default encoding.

public byte[]

Returns:

The path.
getPathAsBytes
()

Returns the path to the UNIX domain socket, as bytes.

public boolean
hasFilename()

Implements abstract org.newsclub.net.unix.AFSocketAddress.hasFilename.

Checks if the address can be resolved to a File.

public static AFUNIXSocketAddress

Returns:

The address.
inAbstractNamespace
(String
The identifier in the abstract namespace, without trailing zero or @.
name
)

Convenience method to create an AFUNIXSocketAddress in the abstract namespace.

public static AFUNIXSocketAddress

Returns:

The address.
inAbstractNamespace
(String
The identifier in the abstract namespace, without trailing zero or @.
name
,
int
The port associated with this socket, or 0 when no port should be assigned.
port
)

Convenience method to create an AFUNIXSocketAddress in the abstract namespace.

public boolean

Returns:

true if the address is in the abstract namespace.
isInAbstractNamespace
()

Checks if the address is in the abstract namespace (or, for Haiku OS, in the internal namespace).

public static boolean

Returns:

true if so.
isSupportedAddress
(InetAddress
The instance to check.
addr
)

Checks if an InetAddress can be unwrapped to an AFUNIXSocketAddress.

public static boolean

Returns:

true if so.
isSupportedAddress
(SocketAddress
The instance to check.
addr
)

Checks if a SocketAddress can be unwrapped to an AFUNIXSocketAddress.

pack-priv static AFUNIXSocketAddress
newAFSocketAddress(int port, final byte[] socketAddress, ObjectPool.Lease<ByteBuffer> nativeAddress)

public AFUNIXServerSocket
newBoundServerSocket()

Overrides org.newsclub.net.unix.AFSocketAddress.newBoundServerSocket.

Creates a new server socket bound to this address.

public AFUNIXSocket
newConnectedSocket()

Overrides org.newsclub.net.unix.AFSocketAddress.newConnectedSocket.

Creates a new socket connected to this address.

public AFUNIXServerSocket
newForceBoundServerSocket()

Overrides org.newsclub.net.unix.AFSocketAddress.newForceBoundServerSocket.

Creates a new server socket force-bound to this address (i.e., any additional call to ServerSocket#bind(SocketAddress) will ignore the passed address and use this one instead.

pack-priv static File
newTempPath(boolean deleteOnExit)

public static AFUNIXSocketAddress

Returns:

A corresponding AFUNIXSocketAddress instance.
of
(final File
The socket to connect to.
socketFile
)

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given file.

public static AFUNIXSocketAddress

Returns:

A corresponding AFUNIXSocketAddress instance.
of
(final File
The socket to connect to.
socketFile
,
int
The port associated with this socket, or 0 when no port should be assigned.
port
)

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given file, assigning the given port to it.

public static AFUNIXSocketAddress

Returns:

A corresponding AFUNIXSocketAddress instance.
of
(final byte[]
The socket address (as bytes).
socketAddress
)

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given byte sequence.

public static AFUNIXSocketAddress

Returns:

A corresponding AFUNIXSocketAddress instance.
of
(final byte[]
The socket address (as bytes).
socketAddress
,
int
The port associated with this socket, or 0 when no port should be assigned.
port
)

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given byte sequence, assigning the given port to it.

public static AFUNIXSocketAddress

Returns:

A corresponding AFUNIXSocketAddress instance.
of
(Path
The socket to connect to.
socketPath
)

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given path.

public static AFUNIXSocketAddress

Returns:

A corresponding AFUNIXSocketAddress instance.
of
(Path
The socket to connect to.
socketPath
,
int
The port associated with this socket, or 0 when no port should be assigned.
port
)

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given path, assigning the given port to it.

public static AFUNIXSocketAddress

Returns:

The address.
of
(URI
The URI.
u
)

Hides org.newsclub.net.unix.AFSocketAddress.of.

Returns an AFUNIXSocketAddress for the given URI, if possible.

public static AFUNIXSocketAddress

Returns:

The address.
of
(URI
The URI.
u
,
int
The port to forcibly use, or -1 for "don't override".
overridePort
)

Hides org.newsclub.net.unix.AFSocketAddress.of.

Returns an AFUNIXSocketAddress for the given URI, if possible.

public static AFUNIXSocketAddress

Returns:

A corresponding AFUNIXSocketAddress instance.
of
(SocketAddress
The address to convert.
address
)

Returns an AFUNIXSocketAddress based on the given SocketAddress.

public static AFUNIXSocketAddress

Returns:

A corresponding AFUNIXSocketAddress instance.
ofNewTempFile
()

Returns an AFUNIXSocketAddress that points to a temporary, non-existent but accessible path in the file system.

public static AFUNIXSocketAddress

Returns:

A corresponding AFUNIXSocketAddress instance.
ofNewTempPath
(int
The port associated with this socket, or 0 when no port should be assigned.
port
)

Returns an AFUNIXSocketAddress that points to a temporary, non-existent but accessible path in the file system, assigning the given port to it.

private static String
prettyPrint(byte[] data)

pack-priv static AFSupplier<AFUNIXSocketAddress>

Returns:

The supplier, or null.
supportedAddressSupplier
(SocketAddress
The address.
addr
)

Checks if the given address can be unwrapped to an AFUNIXSocketAddress, and if so, returns a supplier function; if not, null is returned.

public String
toString()

Overrides java.net.InetSocketAddress.toString.

Constructs a string representation of this InetSocketAddress.

public URI
toURI(String
The target scheme.
scheme
,
URI
An optional template to reuse certain parameters (e.g., the "path" component for an http request), or null.
template
)

Overrides org.newsclub.net.unix.AFSocketAddress.toURI.

Tries to create a URI based on this AFSocketAddress.

public static AFUNIXSocketAddress

Returns:

The AFUNIXSocketAddress instance.
unwrap
(InetAddress
The "special" InetAddress.
address
,
int
The port (use 0 for "none").
port
)

Returns an AFUNIXSocketAddress given a special InetAddress that encodes the byte sequence of an AF_UNIX socket address, like those returned by wrapAddress().

public static AFUNIXSocketAddress

Returns:

The AFUNIXSocketAddress instance.
unwrap
(SocketAddress
The address to unwrap.
address
)

Returns an AFUNIXSocketAddress given a generic SocketAddress.

public static AFUNIXSocketAddress

Returns:

The AFUNIXSocketAddress instance.
unwrap
(String
The "special" hostname, as provided by InetAddress#getHostName().
hostname
,
int
The port (use 0 for "none").
port
)

Returns an AFUNIXSocketAddress given a special InetAddress hostname that encodes the byte sequence of an AF_UNIX socket address, like those returned by wrapAddress().

Inherited from org.newsclub.net.unix.AFSocketAddress:
canMapcanMapcoversgetAddressFamilygetBytesgetInetAddressgetInetAddressgetInetAddressgetNativeAddressDirectBuffergetNativeAddressDirectBuffergetSocketAddressisSupportedAddressisUseDeserializationForInitmapOrFailmapOrFailnewDeserializedAFSocketAddressnewSockAddrDirectBuffernewSockAddrKeyBufferofInternalparseUnsignedIntpreprocessSocketAddressresolveAddresstoSocatAddressStringtoUnsignedStringtoUnsignedStringunwrapunwrapunwrapAddressDirectBufferInternalwrapAddresswriteNativeAddressTo

Field Detail

ADDRESS_CHARSETback to summary
private static final Charset ADDRESS_CHARSET
AF_UNIXback to summary
pack-priv static final AFAddressFamily<@NonNull AFUNIXSocketAddress> AF_UNIX
Annotations
@SuppressWarnings:null
serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.newsclub.net.unix.AFSocketAddress.serialVersionUID.

Constructor Detail

AFUNIXSocketAddressback to summary
private AFUNIXSocketAddress(int port, final byte[] socketAddress, ObjectPool.Lease<ByteBuffer> nativeAddress) throws SocketException
AFUNIXSocketAddressback to summary
public AFUNIXSocketAddress(File socketFile) throws SocketException

Deprecated

Use of(File) instead.

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given file and port. Legacy constructor, do not use!

Parameters
socketFile:File

The socket to connect to.

Annotations
@Deprecated
Exceptions
SocketException:
if the operation fails.
See Also
of(File)
AFUNIXSocketAddressback to summary
public AFUNIXSocketAddress(File socketFile, int port) throws SocketException

Deprecated

Use of(File, int) instead.

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given file. Legacy constructor, do not use!

Parameters
socketFile:File

The socket to connect to.

port:int

The port associated with this socket, or 0 when no port should be assigned.

Annotations
@Deprecated
Exceptions
SocketException:
if the operation fails.
See Also
of(File, int)

Method Detail

addressCharsetback to summary
public static Charset addressCharset()

Returns the Charset used to encode/decode AFUNIXSocketAddresses. This is usually the system default charset, unless that is StandardCharsets#US_ASCII (7-bit), in which case StandardCharsets#ISO_8859_1 is used instead.

Returns:Charset

The charset.

addressFamilyback to summary
public static AFAddressFamily<AFUNIXSocketAddress> addressFamily()

Returns the corresponding AFAddressFamily.

Returns:AFAddressFamily<AFUNIXSocketAddress>

The address family instance.

Annotations
@SuppressWarnings:null
getFileback to summary
public File getFile() throws FileNotFoundException

Implements abstract org.newsclub.net.unix.AFSocketAddress.getFile.

Doc from org.newsclub.net.unix.AFSocketAddress.getFile.

Returns the File corresponding with this address, if possible. A FileNotFoundException is thrown if there is no filename associated with the address, which applies to addresses in the abstract namespace, for example.

Returns:File

The filename.

Annotations
@Override
Exceptions
FileNotFoundException:
if the address is not associated with a filename.
getPathback to summary
public String getPath()

Returns the path to the UNIX domain socket, as a human-readable string using the default encoding. For addresses in the abstract namespace, the US_ASCII encoding is used; zero-bytes are converted to '@', other non-printable bytes are converted to '.'

Returns:String

The path.

See Also
getPathAsBytes()
getPathAsBytesback to summary
public byte[] getPathAsBytes()

Returns the path to the UNIX domain socket, as bytes.

Returns:byte[]

The path.

See Also
getPath()
hasFilenameback to summary
public boolean hasFilename()

Implements abstract org.newsclub.net.unix.AFSocketAddress.hasFilename.

Doc from org.newsclub.net.unix.AFSocketAddress.hasFilename.

Checks if the address can be resolved to a File.

Returns:boolean

true if the address has a filename.

Annotations
@Override
inAbstractNamespaceback to summary
public static AFUNIXSocketAddress inAbstractNamespace(String name) throws SocketException

Convenience method to create an AFUNIXSocketAddress in the abstract namespace. The returned socket address will use the byte representation of this identifier (using the system's default character encoding), prefixed with a null byte (to indicate the abstract namespace is used).

Parameters
name:String

The identifier in the abstract namespace, without trailing zero or @.

Returns:AFUNIXSocketAddress

The address.

Exceptions
SocketException:
if the operation fails.
inAbstractNamespaceback to summary
public static AFUNIXSocketAddress inAbstractNamespace(String name, int port) throws SocketException

Convenience method to create an AFUNIXSocketAddress in the abstract namespace. The returned socket address will use the byte representation of this identifier (using the system's default character encoding), prefixed with a null byte (to indicate the abstract namespace is used).

Parameters
name:String

The identifier in the abstract namespace, without trailing zero or @.

port:int

The port associated with this socket, or 0 when no port should be assigned.

Returns:AFUNIXSocketAddress

The address.

Exceptions
SocketException:
if the operation fails.
isInAbstractNamespaceback to summary
public boolean isInAbstractNamespace()

Checks if the address is in the abstract namespace (or, for Haiku OS, in the internal namespace).

Returns:boolean

true if the address is in the abstract namespace.

isSupportedAddressback to summary
public static boolean isSupportedAddress(InetAddress addr)

Checks if an InetAddress can be unwrapped to an AFUNIXSocketAddress.

Parameters
addr:InetAddress

The instance to check.

Returns:boolean

true if so.

See Also
wrapAddress(), unwrap(InetAddress, int)
isSupportedAddressback to summary
public static boolean isSupportedAddress(SocketAddress addr)

Checks if a SocketAddress can be unwrapped to an AFUNIXSocketAddress.

Parameters
addr:SocketAddress

The instance to check.

Returns:boolean

true if so.

See Also
unwrap(InetAddress, int)
newAFSocketAddressback to summary
pack-priv static AFUNIXSocketAddress newAFSocketAddress(int port, final byte[] socketAddress, ObjectPool.Lease<ByteBuffer> nativeAddress) throws SocketException
newBoundServerSocketback to summary
public AFUNIXServerSocket newBoundServerSocket() throws IOException

Overrides org.newsclub.net.unix.AFSocketAddress.newBoundServerSocket.

Doc from org.newsclub.net.unix.AFSocketAddress.newBoundServerSocket.

Creates a new server socket bound to this address.

Returns:AFUNIXServerSocket

The server socket instance.

Annotations
@Override
Exceptions
IOException:
on error.
newConnectedSocketback to summary
public AFUNIXSocket newConnectedSocket() throws IOException

Overrides org.newsclub.net.unix.AFSocketAddress.newConnectedSocket.

Doc from org.newsclub.net.unix.AFSocketAddress.newConnectedSocket.

Creates a new socket connected to this address.

Returns:AFUNIXSocket

The socket instance.

Annotations
@Override
Exceptions
IOException:
on error.
newForceBoundServerSocketback to summary
public AFUNIXServerSocket newForceBoundServerSocket() throws IOException

Overrides org.newsclub.net.unix.AFSocketAddress.newForceBoundServerSocket.

Doc from org.newsclub.net.unix.AFSocketAddress.newForceBoundServerSocket.

Creates a new server socket force-bound to this address (i.e., any additional call to ServerSocket#bind(SocketAddress) will ignore the passed address and use this one instead.

Returns:AFUNIXServerSocket

The server socket instance.

Annotations
@Override
Exceptions
IOException:
on error.
newTempPathback to summary
pack-priv static File newTempPath(boolean deleteOnExit) throws IOException
ofback to summary
public static AFUNIXSocketAddress of(final File socketFile) throws SocketException

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given file.

Parameters
socketFile:File

The socket to connect to.

Returns:AFUNIXSocketAddress

A corresponding AFUNIXSocketAddress instance.

Exceptions
SocketException:
if the operation fails.
ofback to summary
public static AFUNIXSocketAddress of(final File socketFile, int port) throws SocketException

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given file, assigning the given port to it.

Parameters
socketFile:File

The socket to connect to.

port:int

The port associated with this socket, or 0 when no port should be assigned.

Returns:AFUNIXSocketAddress

A corresponding AFUNIXSocketAddress instance.

Exceptions
SocketException:
if the operation fails.
ofback to summary
public static AFUNIXSocketAddress of(final byte[] socketAddress) throws SocketException

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given byte sequence.

Note

By specifying a byte array that starts with a zero byte, you indicate that the abstract namespace is to be used. This feature is not available on all target platforms.

Parameters
socketAddress:byte[]

The socket address (as bytes).

Returns:AFUNIXSocketAddress

A corresponding AFUNIXSocketAddress instance.

Exceptions
SocketException:
if the operation fails.
See Also
AFUNIXSocketAddress#inAbstractNamespace(String)
ofback to summary
public static AFUNIXSocketAddress of(final byte[] socketAddress, int port) throws SocketException

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given byte sequence, assigning the given port to it.

Note

By specifying a byte array that starts with a zero byte, you indicate that the abstract namespace is to be used. This feature is not available on all target platforms.

Parameters
socketAddress:byte[]

The socket address (as bytes).

port:int

The port associated with this socket, or 0 when no port should be assigned.

Returns:AFUNIXSocketAddress

A corresponding AFUNIXSocketAddress instance.

Exceptions
SocketException:
if the operation fails.
See Also
AFUNIXSocketAddress#inAbstractNamespace(String, int)
ofback to summary
public static AFUNIXSocketAddress of(Path socketPath) throws SocketException

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given path.

Parameters
socketPath:Path

The socket to connect to.

Returns:AFUNIXSocketAddress

A corresponding AFUNIXSocketAddress instance.

Exceptions
SocketException:
if the operation fails.
ofback to summary
public static AFUNIXSocketAddress of(Path socketPath, int port) throws SocketException

Returns an AFUNIXSocketAddress that points to the AF_UNIX socket specified by the given path, assigning the given port to it.

Parameters
socketPath:Path

The socket to connect to.

port:int

The port associated with this socket, or 0 when no port should be assigned.

Returns:AFUNIXSocketAddress

A corresponding AFUNIXSocketAddress instance.

Exceptions
SocketException:
if the operation fails.
ofback to summary
public static AFUNIXSocketAddress of(URI u) throws SocketException

Hides org.newsclub.net.unix.AFSocketAddress.of.

Returns an AFUNIXSocketAddress for the given URI, if possible.

Parameters
u:URI

The URI.

Returns:AFUNIXSocketAddress

The address.

Exceptions
SocketException:
if the operation fails.
ofback to summary
public static AFUNIXSocketAddress of(URI u, int overridePort) throws SocketException

Hides org.newsclub.net.unix.AFSocketAddress.of.

Returns an AFUNIXSocketAddress for the given URI, if possible.

Parameters
u:URI

The URI.

overridePort:int

The port to forcibly use, or -1 for "don't override".

Returns:AFUNIXSocketAddress

The address.

Exceptions
SocketException:
if the operation fails.
ofback to summary
public static AFUNIXSocketAddress of(SocketAddress address) throws IOException

Returns an AFUNIXSocketAddress based on the given SocketAddress. This either simply casts an existing AFUNIXSocketAddress, or converts a UnixDomainSocketAddress to it.

Parameters
address:SocketAddress

The address to convert.

Returns:AFUNIXSocketAddress

A corresponding AFUNIXSocketAddress instance.

Exceptions
SocketException:
if the operation fails.
ofNewTempFileback to summary
public static AFUNIXSocketAddress ofNewTempFile() throws IOException

Returns an AFUNIXSocketAddress that points to a temporary, non-existent but accessible path in the file system.

Returns:AFUNIXSocketAddress

A corresponding AFUNIXSocketAddress instance.

Exceptions
IOException:
if the operation fails.
ofNewTempPathback to summary
public static AFUNIXSocketAddress ofNewTempPath(int port) throws IOException

Returns an AFUNIXSocketAddress that points to a temporary, non-existent but accessible path in the file system, assigning the given port to it.

Parameters
port:int

The port associated with this socket, or 0 when no port should be assigned.

Returns:AFUNIXSocketAddress

A corresponding AFUNIXSocketAddress instance.

Exceptions
IOException:
if the operation fails.
prettyPrintback to summary
private static String prettyPrint(byte[] data)
supportedAddressSupplierback to summary
pack-priv static AFSupplier<AFUNIXSocketAddress> supportedAddressSupplier(SocketAddress addr)

Checks if the given address can be unwrapped to an AFUNIXSocketAddress, and if so, returns a supplier function; if not, null is returned.

Parameters
addr:SocketAddress

The address.

Returns:AFSupplier<AFUNIXSocketAddress>

The supplier, or null.

toStringback to summary
public String toString()

Overrides java.net.InetSocketAddress.toString.

Doc from java.net.InetSocketAddress.toString.

Constructs a string representation of this InetSocketAddress. This string is constructed by calling InetAddress#toString() on the InetAddress and concatenating the port number (with a colon).

If the address is an IPv6 address, the IPv6 literal is enclosed in square brackets, for example: "localhost/[0:0:0:0:0:0:0:1]:80". If the address is unresolved, <unresolved> is displayed in place of the address literal, for example "foo/<unresolved>:80".

To retrieve a string representation of the hostname or the address, use getHostString(), rather than parsing the string returned by this toString() method.

Returns:String

a string representation of this object.

Annotations
@Override
toURIback to summary
public URI toURI(String scheme, URI template) throws IOException

Overrides org.newsclub.net.unix.AFSocketAddress.toURI.

Doc from org.newsclub.net.unix.AFSocketAddress.toURI.

Tries to create a URI based on this AFSocketAddress.

Parameters
scheme:String

The target scheme.

template:URI

An optional template to reuse certain parameters (e.g., the "path" component for an http request), or null.

Returns:URI

The URI.

Annotations
@Override
Exceptions
IOException:
on error.
unwrapback to summary
public static AFUNIXSocketAddress unwrap(InetAddress address, int port) throws SocketException

Returns an AFUNIXSocketAddress given a special InetAddress that encodes the byte sequence of an AF_UNIX socket address, like those returned by wrapAddress().

Parameters
address:InetAddress

The "special" InetAddress.

port:int

The port (use 0 for "none").

Returns:AFUNIXSocketAddress

The AFUNIXSocketAddress instance.

Exceptions
SocketException:
if the operation fails, for example when an unsupported address is specified.
unwrapback to summary
public static AFUNIXSocketAddress unwrap(SocketAddress address) throws SocketException

Returns an AFUNIXSocketAddress given a generic SocketAddress.

Parameters
address:SocketAddress

The address to unwrap.

Returns:AFUNIXSocketAddress

The AFUNIXSocketAddress instance.

Exceptions
SocketException:
if the operation fails, for example when an unsupported address is specified.
unwrapback to summary
public static AFUNIXSocketAddress unwrap(String hostname, int port) throws SocketException

Returns an AFUNIXSocketAddress given a special InetAddress hostname that encodes the byte sequence of an AF_UNIX socket address, like those returned by wrapAddress().

Parameters
hostname:String

The "special" hostname, as provided by InetAddress#getHostName().

port:int

The port (use 0 for "none").

Returns:AFUNIXSocketAddress

The AFUNIXSocketAddress instance.

Exceptions
SocketException:
if the operation fails, for example when an unsupported address is specified.