NNG_SOCKET_ID(3)

πŸ“¦
version 1.12.0 Β· 4 versions
, in ubuntu stonking

πŸ’– nng_socket_id β€” return numeric socket identifier πŸ’–

okay bestie, welcome to the NNG Reference Manual, pull up a chair πŸŽ€


✨ NAME ✨

nng_socket_id β€” return numeric socket identifier. that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

#include <nng/nng.h>

int nng_socket_id(nng_socket s);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, nng_socket_id() hands you back a positive identifier for the socket s β€” but ONLY if s is actually valid, no cap. if it's not valid? she gives you -1. that's the vibe check, and honestly it's giving "we can't be friends" energy 😭

Note πŸ“ a socket counts as valid if it was ever opened with a protocol constructor β€” think stuff like nng_req0_open(). like, once she's been opened, she's iconic forever, periodt. now, sockets that live on the stack or are static should be initialized with the macro NNG_SOCKET_INITIALIZER so they literally cannot be mistaken for a valid socket before they're actually opened. this is the equivalent of not letting a random girl walk into the VIP section 🚫✨ do not skip this step, fr fr.

πŸ‘‘ RETURN VALUES πŸ‘‘

  • the positive value of the socket identifier β€” slay πŸ’–
  • -1 if the socket is invalid β€” tragic, but honest πŸ’€

🌈 ERRORS 🌈

None. literally none. she does not do errors, she only does results. no notes. ✨


🫢 SEE ALSO 🫢


that's the whole page, bestie!! go forth and identify those sockets πŸ’…πŸŒΈπŸ¦‹

this has been your girl from the NNG Reference Manual, dated 2026-06-30 β€” stay iconic, stay valid, and may your sockets never be confused with stack garbage πŸŽ€βœ¨πŸ’œ

πŸ“¦ where this page comes from