NET_DestroyDatagramSocket(3)
π NET_DestroyDatagramSocket(3) π
okay bestie, we're in the SDL_net3 corner of the manual, and this one is literally the goodbye function. it's NET_DestroyDatagramSocket, and it does exactly what it says on the tin: it disposes of a datagram socket you already made earlier. no cap. π«Ά
β¨ NAME β¨
NET_DestroyDatagramSocket β dispose of a previously-created datagram socket. that's it, that's the whole job. it's giving closure. π
πΈ SYNOPSIS πΈ
#include <SDL3_net/SDL_net.h>
void NET_DestroyDatagramSocket(NET_DatagramSocket *sock);
π¦ DESCRIPTION π¦
so here's the tea, and it's important tea: this function will _abandon_ any data that's queued up for sending but hasn't actually made it out to the socket yet. gone. poof. not me emotionally detaching from your unsent packets π
if you need that data to arrive, you have to wait for some kind of confirmation from the remote computer β and that confirmation is something you have to devise yourself, because the library isn't gonna do it for you. and listen: queued data isn't guaranteed to arrive even if the library made efforts to transmit it here. so like, don't come for the library, it tried its best. π
also, any data that already arrived from the remote end of the connection but hasn't been read yet? that's lost too. not "delayed", not "saved for later" β lost. it's giving main character exit, no looking back. π
π FUNCTION PARAMETERS π
sockβ the datagram socket you're destroying. bye boo, you were iconic. β¨
π THREAD SAFETY π
do not operate on the same socket from multiple threads at the same time unless you're supplying a serialization mechanism. like, don't. π
that said, different threads can access different sockets at the same time with zero problems. so like, everyone gets their own toy, no fighting. π§
β AVAILABILITY β
this function has been available since SDL_net 3.0.0. old money, lowkey. π
π₯ SEE ALSO π₯
the whole friend group, fr fr. go read them, iykyk. π
reminder bestie: destroying the socket is permanent. unread incoming data = gone, unconfirmed queued outgoing data = gone. if that matters to you, handle it before you call this. periodt. π
and that's the page!! this manual came to you from SDL_net, version SDL_net 3.2.0, so if you see it out in the wild, that's the vibe check. slay, stay safe, and always read your man pages before you yeet a socket. ππ β¨
π¦ 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