NNG_STREAM_CLOSE(3str)

πŸ“¦ version 1.11, in alpine 3.24

πŸ’– NAME πŸ’–

Okay bestie, welcome to the NNG_STREAM_CLOSE(3str) page from the NNG Reference Manual β€” this one is literally about nng_stream_close, the function that closes a byte stream. Slay. ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <nng/nng.h>

void nng_stream_close(nng_stream *s);

πŸ¦‹ DESCRIPTION πŸ¦‹

So, the nng_stream_close() function closes the byte stream s. That's the whole main-character move. πŸ’…

If any operations are pending, like nng_stream_send() or nng_stream_recv(), they will be terminated with an NNG_ECLOSED error condition. Also, any new operations will fail with NNG_ECLOSED after the connection is closed. Fr fr, it's closed-closed. 😭

Note β€” closing the connection while data is in transmission will likely lead to loss of that data. There is no automatic linger or flush to ensure that the socket send buffers have completely transmitted. So yeah, do not expect a lil goodbye kiss for your data. πŸ’€
Note β€” closing the connection does not free the resources associated with it. Once it is certain that no more operations are pending on the connection, it should be freed with nng_stream_free(). Cleanup is a separate vibe check, bestie. 🧚

🌈 RETURN VALUES 🌈

None. Like, literally none. No return value, no drama. 🫢


⭐ ERRORS ⭐

None. Zero errors listed here. Iconic behavior, honestly. πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯


That's the whole page, bestie! πŸ’– From the NNG Reference Manual, dated 2026-01-13, page NNG_STREAM_CLOSE(3str) β€” bye and stay hydrated! πŸ“πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from