NET_DestroyDatagram(3)
π NET_DestroyDatagram(3) β SDL_net3 FUNCTIONS π
okay so bestie, welcome to the NET_DestroyDatagram page, straight outta the SDL_net3 FUNCTIONS section of the manual. it's giving "clean up your mess" and honestly? we love a responsible queen. π
β¨ NAME β¨
NET_DestroyDatagram β dispose of a datagram packet previously received.
π SYNOPSIS π
#include <SDL3_net/SDL_net.h>
void NET_DestroyDatagram(NET_Datagram *dgram);
π¦ DESCRIPTION π¦
okay so here's the tea, bestie: when you get packets through NET_ReceiveDatagram, you must pass them to this function when you're done with them. like, it's not optional, it's the vibe. this function will free the resources used by that packet and unref its NET_Address. no cap. π§Ήβ¨
if you wanna save the sender's address from the packet past this point, it is safe to call NET_RefAddress() on the address and hold onto its pointer β as long as you call NET_UnrefAddress() on it when you're done with it. basically: you gotta ref before you let go, and unref when you're finished. balanced, as all things should be. βοΈπ
once you call this function, the datagram pointer becomes invalid and should not be used again by the app. like, it's gone, bestie. don't text it, don't call it, don't try to use it. it's giving ghosted. ππ«
πΈ FUNCTION PARAMETERS πΈ
dgramβ the datagram packet to destroy. that's the one you're sending off to the great beyond. πποΈ
π₯ THREAD SAFETY π₯
it is safe to call this function from any thread. periodt. π
π AVAILABILITY π
this function is available since SDL_net 3.0.0. iconic behavior, honestly. π
fr fr, don't forget: if you ref'd that address, you better unref it. we don't leave loose ends in this house. π«Ά
and that's the whole page, bestie! this was served fresh from <strong>SDL_net 3.2.0</strong> β the SDL_net manual, version 3.2.0, with all the copyright and license vibes that come with it. stay slaying, stay safe, and destroy those datagrams responsibly. πβ¨ππ¦πΈπ π«Ά
π¦ where this page comes from
- fedora 43: SDL3_net-devel 3.2.0-2.fc43 Β· Zlib
- fedora 43: SDL3_net-devel 3.2.0-2.fc43 Β· Zlib
- fedora 44: SDL3_net-devel 3.2.0-2.fc44 Β· Zlib
- fedora 44: SDL3_net-devel 3.2.0-2.fc44 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms