NET_DestroyServer(3)

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

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


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