NET_GetAddressString(3)

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

πŸ’– NET_GetAddressString(3) πŸ’–

okay bestie, welcome to the SDL_net3 manual, we're doing the NET_GetAddressString page today and honestly? it's a vibe. let's get into it 🫢


✨ NAME ✨

NET_GetAddressString β€” get a human-readable string from a resolved address. that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3_net/SDL_net.h>

const char * NET_GetAddressString(NET_Address *address);

look at her. one function, one pointer, no drama. iconic ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so this function hands you back a string that's "human-readable", meaning it's probably just a bunch of numbers and symbols staring back at you, like "159.203.69.7" or "2604:a880:800:a1::71f:3001". and no, it is not gonna be the original hostname (so not like "icculus.org", sorry babe 😭). but that's fine!! because it's literally perfect for writing into a log file, etc. πŸ“

🚨 DO NOT free or modify the returned string. not even a little. she belongs to the NET_Address you queried, and she stays valid for as long as that object lives. so either make sure the address holds a reference for as long as you need this string, or make a copy. your call, but choose wisely πŸ’€

also, this will return NULL if resolution is still in progress, or if resolution straight up failed πŸ™ˆ. you can use NET_GetAddressStatus() or NET_WaitUntilResolved() to make sure resolution has successfully completed before you call this. like, do the vibe check first, bestie.


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • address β€” the NET_Address to query. that's the one, that's your girl πŸ‘‘

🌈 RETURN VALUE 🌈

returns a string, or NULL on error β€” and if you get that NULL, call SDL_GetError() for the details. she'll tell you what went wrong fr fr.


πŸ‘‘ THREAD SAFETY πŸ‘‘

it is safe to call this function from any thread. go wild, no cap. 🧚


⭐ AVAILABILITY ⭐

this function is available since SDL_net 3.0.0. she's been here, she's been slaying.


πŸ”₯ SEE ALSO πŸ”₯


okay that's the whole page, you ate that πŸ“

this cutie came to you from SDL_net, version SDL_net 3.2.0, and she's out here serving the NET_GetAddressString(3) fantasy. mwah πŸ’‹ see you in the next manpage bestie πŸ’–βœ¨

πŸ“¦ where this page comes from