Class UnixDomainSocketAddress
java.lang.Object
java.net.SocketAddress
java.net.UnixDomainSocketAddress
- All Implemented Interfaces:
Serializable
public final class UnixDomainSocketAddress extends SocketAddress
A Unix domain socket address. A Unix domain socket address encapsulates a file-system path that Unix domain sockets bind or connect to.
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. |
Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait | Modifier and Type | Method | Description |
|---|---|---|
protected Object |
clone() |
Creates and returns a copy of this object. |
protected void |
finalize() |
Deprecated, for removal: This API element is subject to removal in a future version. Finalization is deprecated and subject to removal in a future release. |
final Class |
getClass() |
Returns the runtime class of this Object. |
final void |
notify() |
Wakes up a single thread that is waiting on this object's monitor. |
final void |
notifyAll() |
Wakes up all threads that are waiting on this object's monitor. |
final void |
wait() |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
Method Details
of
public static UnixDomainSocketAddress of(String pathname)
Creates a UnixDomainSocketAddress from the given path string.
- 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)
Creates a UnixDomainSocketAddress for the given 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.
- Returns:
- this address's path
hashCode
equals
toString
© 1993, 2025, 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.