getpeername or getsockname (BPX1GNM, BPX4GNM) — Get the name of a socket or of the peer connected to a socket

See getsockname or getpeername (BPX1GNM, BPX4GNM) - Get the name of a socket or connected peer.