Top Description Fields Constructors Methods
jnr.unixsocket

public final Class Credentials

extends Object
Class Inheritance
Imports
jnr.constants.platform.SocketLevel, .SocketOption

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 and UnixDatagramChannel#getOption.

See also: socket (7)

Field Summary

Modifier and TypeField and Description
private final Ucred

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static Credentials
public int

Returns:

The EGID.
getGid
()

Retrieves the peer's numeric effective group ID.

public int

Returns:

The PID.
getPid
()

Retrieves the peer's process ID.

public int

Returns:

The EUID.
getUid
()

Retrieves the peer's numeric effective user ID.

public String
toString()

Overrides java.lang.Object.toString.

Returns a human readable description of this instance.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

ucredback to summary
private final Ucred ucred

Constructor Detail

Credentialsback to summary
pack-priv Credentials(Ucred ucred)

Method Detail

getCredentialsback to summary
pack-priv static Credentials getCredentials(int fd)
getGidback to summary
public int getGid()

Retrieves the peer's numeric effective group ID.

Returns:int

The EGID.

getPidback to summary
public int getPid()

Retrieves the peer's process ID.

Returns:int

The PID.

getUidback to summary
public int getUid()

Retrieves the peer's numeric effective user ID.

Returns:int

The EUID.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a human readable description of this instance.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override