NET_DestroyDatagram(3)

πŸ“¦
version 3.2.0 Β· 2 versions
, in fedora 43, fedora 44

πŸ’– 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