sock_open(3z)
π sock_open(3z) π
okay bestie, we're in the z88dk Programmer's Manual and this is the page for sock_open β yes the (3z) is part of the whole vibe, it's a section 3 library call, we love a library call π«Ά
β¨ NAME β¨
sock_open β open an active network connection
like, you're the one reaching out. you're sliding into the server's DMs. active energy, no listening around here π
πΈ SYNOPSIS πΈ
#include <net/socket.h>
SOCKET *sock_open(ipaddr_t ipdest, tcpport_t dport,
void (*handler)(), char proto);
that's the whole handshake, bestie. four things and you're online β¨
π¦ DESCRIPTION π¦
so sock_open() does two things at once, main character behavior fr fr:
- it creates a socket descriptor
- it attempts to establish a connection to the port
dporton the hostipdest, using the protocolproto
and listen β right now, the only protocols that are actually supported are prot_UDP and prot_TCP. that's it. those two. anything else and we're not doing this today π
the handler parameter specifies a handler that gets called whenever the connection changes state or new data arrives. that's what it does. ngl though, it's of archaic interest only β which is the manual's polite way of saying "it's a relic, it's giving museum piece, don't build your whole personality around it" π
π RETURN VALUE π
sock_open() returns a socket descriptor. slay. that's the win condition π
but if you specify a protocol that isn't supported? the carry flag gets set and the return value is EPROTONOSUPPORT. so like, not a vibe. check your proto, bestie, because that's the whole error report you're getting π
π SEE ALSO π
sock_listen(3z)
the sibling page. the other half of the duo. if sock_open is sliding into DMs, sock_listen is waiting by the phone π
π AUTHOR π
Dominic Morris <dom@jb.man.ac.uk>
thank you king, we are obsessed π«Ά
and that's the whole page, periodt π
this lil rewrite was born from the z88dk Programmer's Manual, and the original page is dated 18 February 2000 β yeah, a Y2K baby, iconic behavior honestly β
okay ily, go open a socket, be safe, and don't forget the carry flag πβ¨π
π¦ 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