[ Version ( since = "2.26" ) ]
public Credentials get_credentials () throws Error
Returns the credentials of the foreign process connected to this socket, if any (e.
g. it is only supported for g_socket_family_unix sockets).
If this operation isn't supported on the OS, the method fails with the g_io_error_not_supported error. On Linux this is implemented by reading the so_peercred option on the underlying socket.
This method can be expected to be available on the following platforms:
Other ways to obtain credentials from a foreign peer includes the UnixCredentialsMessage type and send_credentials / receive_credentials functions.
| this |
a Socket. |
|
null if throws is set, otherwise a Credentials object that must be freed with unref. |