- CredentialsErrorReason.CLOSED — no connected peer
was captured (never connected, or closed since)
- CredentialsErrorReason.UNSUPPORTED — the platform
has no peer-credential query
- CredentialsErrorReason.ERROR — system error;
errnocarries the code
UnixConnection.peerCredentials
Query the credentials of the connected peer.
Values are captured when the connection is established (adopt, finished connect) and pinned by the kernel at connect time, so they remain valid after the peer exits. Availability of individual fields is explicit in PeerCredentials. Identity is not authorization.
Returns
The captured credentials, or a CredentialsError: