NN_SHUTDOWN(3compat)
π NN_SHUTDOWN(3compat) β the NNG Reference Manual, bestie edition π
okay so real talk, this is nn_shutdown from the NNG Reference Manual, and it's one of those legacy-compat girlies β¨ so let's get into it.
πΈ NAME πΈ
nn_shutdown β shut down endpoint (compatible API) π«Ά
β¨ SYNOPSIS β¨
#include <nanomsg/nn.h>
int nn_shutdown(int sock, int ep)
that's it, that's the whole vibe check. two ints in, one int out π
π DESCRIPTION π
okay so nn_shutdown() literally shuts down the endpoint ep on the socket sock β and ep can be either a listener or a dialer, doesn't matter which, both are valid, slay π
the way this works is it stops the socket from accepting new connections, or from establishing old ones (yes, "establishing old ones" β that's what it says, i don't make the rules). and on top of that? any established connections associated with ep get closed too. periodt. π₯
π Note β this function is provided for API compatibility with legacy libnanomsg. consider using the relevant modern API instead. no cap, the modern API is the main character here π this one's just here for the nostalgia.
β RETURN VALUES β
- returns zero on success π
- returns -1 on error π
like, zero is the good one, remember that, iykyk π
π ERRORS π
EBADFβ the socketsockis not open. bestie. you can't shut down a socket that isn't even open, come on πEINVALβ an invalidepwas supplied. that endpoint did not pass the vibe check, so it's giving error π©
π¦ SEE ALSO π¦
nn_bind(3compat)nn_connect(3compat)nn_errno(3compat)nn_socket(3compat)nn_compat(3compat)nng(7)
go read those, they're iconic, i promise ππ
and that's the whole page, bestie! this one's from the NNG Reference Manual and it's dated 2026-01-13 β so yeah, fresh, current, timestamped and everything β°π go forth and shut down those endpoints responsibly, mwah π§ββοΈπ
π¦ where this page comes from
- alpine 3.24: nng-doc 1.11-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms