NET_DestroyServer(3)
π NET_DestroyServer π
okay bestie, so this is a page from the SDL_net3 manual β specifically the NET_DestroyServer(3) entry, and honestly? it's a short one, but it's important, so sit with me for a sec π«Ά
β¨ NAME β¨
NET_DestroyServer β dispose of a previously-created server. like, bye bye server, we hardly knew ye π
πΈ SYNOPSIS πΈ
#include <SDL3_net/SDL_net.h>
void NET_DestroyServer(NET_Server *server);
π¦ DESCRIPTION π¦
okay so here's the tea: calling this will immediately disconnect any pending client connections that hadn't been accepted yet. like, those ones are just gone, no takebacks, no goodbye text π
BUT β and this is the part everyone gets wrong β it will not disconnect any existing accepted connections. those are still totally fine, they can still be used, and you have to destroy them separately. they're their own thing now. they grew up. main character energy π
and after you do this? further attempts to make new connections to this server will fail on the client side. so yeah, door's closed, no new guests πͺ
π FUNCTION PARAMETERS π
serverβ the server to destroy. that's it. that's the whole parameter. slay β¨
π§ THREAD SAFETY π§
ngl this one matters. you should not operate on the same server from multiple threads at the same time unless you supply a serialization mechanism. no cap, don't do it π
however β different threads may access different servers at the same time without problems. so like, share the vibes, not the server π
π AVAILABILITY π
this function has been available since SDL_net 3.0.0. it's been here. it's iconic. periodt β
π« SEE ALSO π«
NET_CreateServer(3)β the one that made the server in the first place, iykyk π₯
and that's the whole page, bestie!! π this was NET_DestroyServer(3) from the SDL_net3 functions crew, sitting all cute inside SDL_net 3.2.0 β written by the SDL_net girlies, documented for us, and now lovingly explained to you. go forth and destroy some servers 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