NNG_AIO_STOP(3)

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

✨ NAME ✨

nng_aio_stop β€” stoppp that asynchronous I/O operation bestie, we're done here πŸ’…

It's from the NNG Reference Manual, section 3, and honestly? It's giving "clean shutdown" and I'm obsessed 🫢


🌸 SYNOPSIS 🌸

#include <nng/nng.h>

void nng_aio_stop(nng_aio *aio);

πŸŽ€ DESCRIPTION πŸŽ€

Okay so nng_aio_stop() is the girl who ends things properly. She takes the asynchronous I/O operation hanging out with aio and stops it by aborting it with NNG_ECANCELED 😭 β€” and then she doesn't just walk away. No ma'am. She waits for it to fully complete or to be completely aborted, and she also waits for the callback that's attached to the aio to finish executing. Full closure. Main character behaviour fr fr πŸ‘‘

And after all that? Any further calls to nng_aio_begin() using this aio will return false. Like, it's over over. The door is closed, the lights are off, the vibe is sealed ✨

The iconic part: it is safe to call this for an aio even when literally no operation is currently pending for it. Zero drama, zero judgement. She just handles it πŸ’–

Tip 🧚 When you've got multiple asynchronous I/O handles in use and they all need to be shut down, it is safest to stop all of them before deallocating any of them with nng_aio_free(). Especially if the callbacks might try to reschedule additional operations β€” like, do NOT free first, that's a jump scare. Stop everything, then free. Periodt πŸ’€

🌈 RETURN VALUES 🌈

None. She gives you nothing back because she already gave you everything 🫢


πŸ’œ ERRORS πŸ’œ

None. No errors, no notes, we love a flawless queen πŸ’…


πŸ¦‹ SEE ALSO πŸ¦‹


okay that's the whole page, go stop your async ops responsibly bestie πŸŽ€βœ¨

This lil drop is from the NNG Reference Manual, dated 2026-06-30. Drink water, close your handles, bye πŸ¦‹πŸ’–

πŸ“¦ where this page comes from