NNG_RECVMSG(3)
π NNG_RECVMSG(3) β it's giving receive a message
okay bestie, welcome to the NNG Reference Manual page for nng_recvmsg, and honestly? she's a baddie. let's get into it π
β¨ NAME β¨
nng_recvmsg β receive a message π«Ά
β¨ SYNOPSIS β¨
#include <nng/nng.h>
int nng_recvmsg(nng_socket s, nng_msg **msgp, int flags);
β¨ DESCRIPTION β¨
So here's the tea: nng_recvmsg() receives a message on socket s, and it stores that received message at the location pointed to by msgp. that's it, that's the whole vibe π
Tip πΈ using this function gives you access to the message structure, so likeβ¦ it may offer more functionality than the simpler nng_recv() function. lowkey iconic of her.
The flags may contain the following value:
NNG_FLAG_NONBLOCKβ the function returns immediately, even if no message is available, bestie. without this flag? she will wait until a message is received by the sockets, or until any configured timer expires. no cap, she's patient like that β³
Note π¦ the semantics of what receiving a message even means varies from protocol to protocol, so please, for the love of everything, go read the protocol documentation. it's encouraged!! (for example: with areqsocket, a message may only be received after a request has been sent, and asubsocket may only receive messages corresponding to topics to which it has subscribed.) and also, some protocols may not support receiving data at all, such aspub. so yeah, vibe check your protocol first fr fr π
β¨ RETURN VALUES β¨
this function returns 0 on success, and non-zero otherwise. simple. clean. slay β¨
β¨ ERRORS β¨
NNG_EAGAINβ the operation would block, butNNG_FLAG_NONBLOCKwas specified. πNNG_ECLOSEDβ the socketsis not open.NNG_EINVALβ an invalid set of flags was specified. πNNG_ENOMEMβ insufficient memory is available. πNNG_ENOTSUPβ the protocol for socketsdoes not support receiving.NNG_ESTATEβ the socketscannot receive data in this state. it's not her moment, okay?!NNG_ETIMEDOUTβ the operation timed out. β°
β¨ SEE ALSO β¨
nng_msg_free(3), nng_recv(3), nng_sendmsg(3), nng_strerror(3), nng_socket(5), nng(7)
and that's the whole page, bestie!! π this was the NNG Reference Manual, dated 2026-06-30, and you absolutely ate reading all of it. go forth and nng_recvmsg() responsibly ππ¦β¨ periodt.
π¦ 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