public final class Credentials
extends java.lang.Object
An instance of this class can be retrieved, using either the socket-level methods
UnixSocket.getCredentials()
and UnixDatagramSocket.getCredentials()
or by specifying
UnixSocketOptions.SO_PEERCRED
as argument to one of the
channel-level methods UnixSocketChannel.getOption(java.net.SocketOption<T>)
and UnixDatagramChannel.getOption(java.net.SocketOption<T>)
.
See also: socket (7)
Constructor and Description |
---|
Credentials(Ucred ucred) |
Modifier and Type | Method and Description |
---|---|
(package private) static Credentials |
getCredentials(int fd) |
int |
getGid()
Retrieves the peer's numeric effective group ID.
|
int |
getPid()
Retrieves the peer's process ID.
|
int |
getUid()
Retrieves the peer's numeric effective user ID.
|
java.lang.String |
toString()
Returns a human readable description of this instance.
|
private final Ucred ucred
Credentials(Ucred ucred)
public int getPid()
public int getUid()
public int getGid()
public java.lang.String toString()
toString
in class java.lang.Object
static Credentials getCredentials(int fd)