sock_close(3z)
π sock_close β the manual, but make it slay β¨
okay bestie, welcome to the z88dk Programmer's Manual glow-up edition, where we're talking about sock_close(3z) β yes, that's the one in the 3z section, the C library zone. it's giving "closing time, doors are shutting, but respectfully" πͺβ¨
πΈ NAME πΈ
sock_close β close a network connection π«Ά
like, say goodbye. hang up. end the call. it's over (but politely).
π¦ SYNOPSIS π¦
#include <net/socket.h>
void sock_close(SOCKET *s);
that's it. that's the whole vibe. one function, one pointer, zero return value. icon behaviour honestly π
π DESCRIPTION π
so the parameter s? it's a descriptor to an open socket β and it's gotta be one that was made with sock_open(3z) or sock_listen(3z). no making up sockets out of thin air, bestie, that's not the move π
the sock_close() function will initiate a close on the socket specified by s. once you've called this function, no more data can be written to the socket. periodt. the write era is OVER. π«βοΈ
but β and this is the plot twist β if the socket is of type prot_TCP, then data can continue to be read. so like, the talking-into-the-void part is done, but you can still listen. reading main character energy only. π
lowkey important: this is a close being initiated, and the write-shutoff is immediate. don't be out here trying to write after you've called it, you will simply not be writing. π
β¨ RETURN VALUE β¨
None. nada. nothing. it returns void and it means it. no status code to check, no vibes to interpret β it just does the thing. π
π SEE ALSO π
sock_abort(3z)β the dramatic exit π€sock_shutdown(3z)β the other shutdown-ish situation
go read those too, iykyk. π§
π AUTHOR π
Dominic Morris <dom@jb.man.ac.uk> β the og, the legend, the one who wrote the thing π
and that's the whole page, bestie!! this lil masterpiece comes straight out of the z88dk Programmer's Manual, and the date on it is 18 February 2000 β vintage, retro, still iconic. sock_close(3z) forever. mwah π
πβ¨πΈπ¦π
π¦ 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