socket_getpeername
-- Queries the remote side of the given socket which may
either result in host/port or in a UNIX filesystem path,
dependent on its type.
socket_getsockname
-- Queries the local side of the given socket which may
either result in host/port or in a UNIX filesystem path,
dependent on its type.