GETPEERNAME(1)

hiii bestie πŸ’– welcome to GETPEERNAME(1) from the General Commands Manual β€” the manual page that's all about finding out who your socket is talking to. no cap. πŸ¦‹


✨ NAME ✨

getpeername β€” get name of connected TCP/IP peer πŸ‘‘

πŸ“œ SYNOPSIS πŸ“œ

getpeername [-n] [-p protocol]

πŸ’– DESCRIPTION πŸ’–

okay so, getpeername prints the IP address and service name (the port number) of the remote peer connected to standard input. the IP address and the service name are printed on the same line, separated by one space. it's giving "who dis?" but for sockets. πŸ’…

πŸŽ€ OPTIONS πŸŽ€

  • -n β€” Don't translate IP addresses and port numbers to names. literally leave them as-is, raw and unfiltered. πŸ™ˆ
  • -p protocol β€” Force getpeername to use protocol as the protocol when translating port numbers to service names. protocol can be tcp and udp. Normally, getpeername automatically determines what type of socket it is connected to. πŸ”₯

πŸ‘€ SEE ALSO πŸ‘€

getpeername(3). β€” yes bestie, go read the library version too, iykyk 🫢

πŸ’€ BUGS πŸ’€

Only works on IP sockets. that's the whole mood. 😭

and that's the page! this one is from the General Commands Manual, dated 1997 April 13, and it's GETPEERNAME(1) signing off. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from