Serializable
public final class UnixDomainSocketAddress extends SocketAddress
An unnamed UnixDomainSocketAddress
has an empty path. The local address of a SocketChannel
to a Unix domain socket that is automatically or implicitly bound will be unnamed.
Path
objects used to create instances of this class must be obtained from the system-default file system.
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals |
Compares this address with another object. |
Path |
getPath() |
Returns this address's path. |
int |
hashCode() |
Returns the hash code of this UnixDomainSocketAddress
|
static UnixDomainSocketAddress |
of |
Creates a UnixDomainSocketAddress from the given path string. |
static UnixDomainSocketAddress |
of |
Creates a UnixDomainSocketAddress for the given path. |
String |
toString() |
Returns a string representation of this UnixDomainSocketAddress . |
public static UnixDomainSocketAddress of(String pathname)
pathname
- The path string, which can be emptyInvalidPathException
- If the path cannot be converted to a PathNullPointerException
- if pathname is null
public static UnixDomainSocketAddress of(Path path)
path
- The path to the socket, which can be emptyIllegalArgumentException
- If the path is not associated with the default file systemNullPointerException
- if path is null
public Path getPath()
public int hashCode()
UnixDomainSocketAddress
public boolean equals(Object o)
public String toString()
UnixDomainSocketAddress
.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/UnixDomainSocketAddress.html