sock_dataready(3z)
π sock_dataready(3z) π
okay bestie, pull up a chair, because we're talking about sock_dataready(3z) β a lil function from the z88dk Programmer's Manual that answers the most iconic question in all of networking: "is there mail for me??" π¬β¨
β¨ NAME β¨
sock_dataready β test whether a network connection has incoming data π¦
β¨ SYNOPSIS β¨
#include <net/socket.h>
size_t sock_dataready(SOCKET *s);
β¨ DESCRIPTION β¨
So the parameter s is a descriptor to an open socket β and not just any socket, a socket you made with sock_open(3z) or sock_listen(3z). π
like, it has to already exist, bestie, we're not manifesting sockets out of thin air.
The sock_dataready() function tests whether a socket has data waiting to be read by the user program. that's it. that's the whole job. it's giving receptionist checking if you have a package π¦ β it does not hand you the package, it just tells you one is there. so lowkey essential before you go reading, no cap.
β¨ RETURN VALUE β¨
sock_dataready() returns the amount of data waiting in the input queue. π₯ so like, a number. the actual size of the pile of goodies sitting in the queue. zero means nothing's there, so don't go reading and act surprised, okay? π
β¨ SEE ALSO β¨
sock_read(3z)β the one that actually takes the data, iykyk π«Ά
β¨ AUTHOR β¨
Dominic Morris <dom@jb.man.ac.uk> β the icon, the legend, the moment π
mwah π that's the whole page! z88dk Programmer's Manual, dated 18 February 2000 β yeah bestie, this one is vintage vintage, a true Y2K relic πβ¨ go forth and check your sockets before you read from them, 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