NNG_SOCKET_ID(3)
π 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 likenng_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 macroNNG_SOCKET_INITIALIZERso 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 π
-1if 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
- ubuntu stonking: libnng-dev 1.12.0-1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms