sdlNetGetAddressStatus function
Check if an address is resolved, without blocking.
The SDLNet_Address objects returned by SDLNet_ResolveHostname take time to do their work, so it is does so asynchronously instead of making your program wait an indefinite amount of time.
This function allows you to check the progress of that work without blocking.
Resolution can fail after some time (DNS server took awhile to reply that the hostname isn't recognized, etc), so be sure to check the result of this function instead of assuming it worked because it's non-zero!
Once an address is successfully resolved, it can be used to connect to the host represented by the address.
\param address The SDLNet_Address to query. \returns 1 if successfully resolved, -1 if resolution failed, 0 if still resolving; if -1, call SDL_GetError() for details.
\threadsafety It is safe to call this function from any thread.
\since This function is available since SDL_Net 3.0.0.
\sa SDLNet_WaitUntilResolved
extern SDL_DECLSPEC int SDLCALL SDLNet_GetAddressStatus(SDLNet_Address *address)
Implementation
int sdlNetGetAddressStatus(Pointer<SdlNetAddress> address) {
final sdlNetGetAddressStatusLookupFunction = libSdl3Net.lookupFunction<
Int32 Function(Pointer<SdlNetAddress> address),
int Function(Pointer<SdlNetAddress> address)>('SDLNet_GetAddressStatus');
return sdlNetGetAddressStatusLookupFunction(address);
}