Package jnr.unixsocket
Class UnixSocketAddress
java.lang.Object
java.net.SocketAddress
jnr.unixsocket.UnixSocketAddress
- All Implemented Interfaces:
Serializable
This class represents an AF_UNIX-style socket address.
On Linux, it supports the platform-specific abstract name space.
Using an abstract name space is denoted by the socket path starting with a NUL byte. Sockets in abstract name space have no entry in the file system. When linux performs autobind, it constructs the resulting path with a leading NUL, followed by a unique 5-digit hexadecimal number.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
(package private) SockAddrUnix
int
hashCode()
Returns a human readable path.(package private) int
length()
path()
Retrieves the path.private void
toString()
Retrieves a human readable description of this address.private void
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
address
-
-
Constructor Details
-
UnixSocketAddress
UnixSocketAddress() -
UnixSocketAddress
-
UnixSocketAddress
-
-
Method Details
-
getStruct
SockAddrUnix getStruct() -
length
int length() -
path
Retrieves the path.- Returns:
- The path of this AF_UNIX address. Note: On Linux, can contain a leading NUL byte, if this address resides in abstract namespace.
-
humanReadablePath
Returns a human readable path. On Linux, AF_UNIX sockets can be bound/connected in abstract namespace. This is denoted by a leading NUL byte in the path. In order to be properly displayed, this method returns a path prefixed by '@' like netstat, lsof an similar tools.- Returns:
- The human readable path of this address.
-
toString
Retrieves a human readable description of this address. -
equals
-
hashCode
public int hashCode() -
writeObject
- Throws:
IOException
-
readObject
- Throws:
IOException
ClassNotFoundException
-