Class UnixDomainSocketAddress
- All Implemented Interfaces:
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.
- Since:
- 16
- See Also:
Method Summary
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 . |
Method Details
of
public static UnixDomainSocketAddress of(String pathname)
- Parameters:
-
pathname
- The path string, which can be empty - Returns:
- A UnixDomainSocketAddress
- Throws:
-
InvalidPathException
- If the path cannot be converted to a Path -
NullPointerException
- if pathname isnull
of
public static UnixDomainSocketAddress of(Path path)
- Parameters:
-
path
- The path to the socket, which can be empty - Returns:
- A UnixDomainSocketAddress
- Throws:
-
IllegalArgumentException
- If the path is not associated with the default file system -
NullPointerException
- if path isnull
getPath
public Path getPath()
- Returns:
- this address's path
hashCode
public int hashCode()
UnixDomainSocketAddress
equals
public boolean equals(Object o)
toString
public String toString()
UnixDomainSocketAddress
.
© 1993, 2021, 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/17/docs/api/java.base/java/net/UnixDomainSocketAddress.html