NET_GetAddressStatus(3)
π NET_GetAddressStatus(3) π
okay bestie, welcome to the SDL_net3 section of the manual, and today we're talking about NET_GetAddressStatus β the little function that lets you peek at your DNS resolution like a nosy queen without ever getting stuck waiting. π΅οΈβοΈβ¨
β¨ NAME β¨
NET_GetAddressStatus β check if an address is resolved, without blocking. π
πΈ SYNOPSIS πΈ
#include <SDL3_net/SDL_net.h>
NET_Status NET_GetAddressStatus(NET_Address *address);
π¦ DESCRIPTION π¦
so here's the tea β: the NET_Address objects you get back from NET_ResolveHostname take time to do their thing. like, actual real-world time, because DNS is out here living its life. so instead of making your whole program sit there waiting an indefinite amount of time like a sad little NPC, it does its work asynchronously. π«Ά
this function right here? it lets you check the progress of that work without blocking. literally just a little vibe check on your address. π
β οΈ important bestie: resolution can fail after some time (DNS server took a while to reply that the hostname isn't recognized, etc.), so be sure to check the result of this function instead of just assuming it worked because it's non-zero! π no cap, that's how you get bugs.
once an address is successfully resolved, it can be used to connect to the host represented by the address. periodt. π
π FUNCTION PARAMETERS π
addressβ theNET_Addressyou wanna query. that's it, that's the whole vibe. π
β RETURN VALUE β
NET_SUCCESSβ yay! successfully resolved. slay. β¨NET_FAILUREβ resolution failed. π if you get this, callSDL_GetError()for details.NET_WAITINGβ still resolving, bestie. this function timed out without resolution. give it a sec. β³
π₯ THREAD SAFETY π₯
it is safe to call this function from any thread. go off, multithreaded icon. π§΅π
π AVAILABILITY π
this function is available since SDL_net 3.0.0. vintage but make it fresh. π
π SEE ALSO π
NET_WaitUntilResolved(3)β the patient bestie who actually waits. π«Ά
mwah π that's the whole page, diva. this was SDL_net 3.2.0, brought to you by the SDL_net girlies, and you absolutely ate this documentation. no notes. πβ¨π¦
π¦ 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