sock_closed(3z)
β¨ sock_closed β¨
okay so bestie, real talk β this is the z88dk Programmer's Manual and we're talking about sock_closed(3z), which is literally just the "is this socket ghosting me?" detector π
πΈ NAME πΈ
sock_closed β test whether a network connection is closed
π¦ SYNOPSIS π¦
#include <net/socket.h>
bool_t sock_closed(SOCKET *s);
π DESCRIPTION π
So. The parameter s? That's a descriptor to a socket. And not just any socket β one you made with sock_open(3z) or sock_listen(3z). Those are the only ones invited to this party, no random sockets showing up unannounced π
What sock_closed() does is test whether a socket is closed β and yes, "closed" here means exactly what you think. Either the connection to a remote host was never established in the first place, or it already got closed by the kernel. Either way, it's giving "this link is not it" π
Heads up though: a socket of prot_UDP is never closed. Like, never ever. UDP said "I'm not leaving" and honestly? Respect. π«Ά
π RETURN VALUE π
sock_closed() returns TRUE or FALSE. That's it. That's the whole vibe check. β
π SEE ALSO π
sock_opened(3z)β the other half of the duo, iykyk
π AUTHOR π
Dominic Morris <dom@jb.man.ac.uk> β the icon who wrote this, we stan π«Ά
and that's the whole page, bestie!! this one came from the z88dk Programmer's Manual, dated 18 February 2000 β yes she's vintage, yes she still slays, periodt πβ¨
π¦ where this page comes from
- fedora 43: z88dk 1.10.1-33.20150709cvs.fc43 Β· ClArtistic
- fedora 44: z88dk 1.10.1-33.20150709cvs.fc43 Β· ClArtistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms