Package jnr.unixsocket
Class Credentials
java.lang.Object
jnr.unixsocket.Credentials
This class represents the peer credentials, retrievable from an AF_UNIX socket.
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)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static CredentialsgetCredentials(int fd) intgetGid()Retrieves the peer's numeric effective group ID.intgetPid()Retrieves the peer's process ID.intgetUid()Retrieves the peer's numeric effective user ID.toString()Returns a human readable description of this instance.
-
Field Details
-
ucred
-
-
Constructor Details
-
Credentials
Credentials(Ucred ucred)
-
-
Method Details
-
getPid
public int getPid()Retrieves the peer's process ID.- Returns:
- The PID.
-
getUid
public int getUid()Retrieves the peer's numeric effective user ID.- Returns:
- The EUID.
-
getGid
public int getGid()Retrieves the peer's numeric effective group ID.- Returns:
- The EGID.
-
toString
Returns a human readable description of this instance. -
getCredentials
-