sock_opened(3z)

πŸ“¦ version 1.10.1, in fedora 43, fedora 44

πŸ’– sock_opened(3z) β€” like, the z88dk bestie manual πŸ’–

okay so bestie, we're in the z88dk Programmer's Manual today and the main character of this page is sock_opened. she's a little function, she's got one job, and she does it flawlessly. no cap. ✨


🌸 NAME 🌸

sock_opened β€” test whether a network connection is established πŸ¦‹

like... is the socket open or not. that's the whole vibe check. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <net/socket.h>

bool_t sock_opened(SOCKET *s);

✨ DESCRIPTION ✨

so the parameter s is a descriptor to a socket, right? and that socket has to have been made with sock_open(3z) or sock_listen(3z). those are her parents, her origin story, her lore. 🌈

the sock_opened() function tests whether a socket is open β€” meaning, like, whether the connection to a remote host has been established. is the link up? are we connected? she will tell you. 🫢

and here's the lil plot twist: a socket of prot_UDP is always established. like always always. it just is. don't question her. 😭

πŸ‘‘ RETURN VALUE πŸ‘‘

sock_opened() returns TRUE or FALSE. that's it. two options. binary. iconic. she's not giving you a maybe, she's not giving you a spectrum, she's giving you the truth. ⭐


πŸ”₯ SEE ALSO πŸ”₯

  • sock_closed(3z)

πŸ’œ AUTHOR πŸ’œ

Dominic Morris <dom@jb.man.ac.uk>


and that's the whole page bestie!! this one's from 18 February 2000 and it lives in the z88dk Programmer's Manual β€” so like, respect the elders, they were doing sockets before it was cool. πŸ§šπŸ’–

πŸ“¦ where this page comes from