NNG_LISTENER_ID(3)

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

✨ NAME ✨

nng_listener_id β€” return numeric listener identifier. πŸŽ€ This page is from the NNG Reference Manual, and it's here to help you grab that listener ID, bestie.

🌸 SYNOPSIS 🌸

#include <nng/nng.h>

int nng_listener_id(nng_listener l);

πŸ’– DESCRIPTION πŸ’–

okay so nng_listener_id() returns a positive identifier for the listener l, but only if l is valid. Otherwise? It returns -1. That's the whole vibe. ✨

🫢 Note 🫢

A listener is considered valid if it was ever created with the nng_listener_create() or nng_listen() functions. And listen: listeners that are allocated on the stack or statically should be initialized with the macro NNG_LISTENER_INITIALIZER, to ensure that they cannot be confused with a valid listener before they are created properly. Don't skip that step, fr fr. πŸ¦‹

🌈 RETURN VALUES 🌈

This function returns the positive value for the listener identifier, or -1 if the listener is invalid. So: positive identifier = valid listener, -1 = invalid. Simple as that. πŸ’…

😭 ERRORS 😭

None. Not a single error listed. Iconic. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘


This page was brought to you by the NNG Reference Manual, dated 2026-06-30. Stay slay, bestie. πŸ«ΆπŸ’–

πŸ“¦ where this page comes from