sock_puts(3z)

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

πŸ’– sock_puts(3z) β€” bestie edition πŸ’–

okay so this page lives in the z88dk Programmer's Manual and it's literally all about yeeting a whole string at a network socket. no cap. let's get into it πŸ¦‹


✨ NAME ✨

sock_write β€” write string to a network socket

not me pointing out that the NAME section says sock_write while the function itself is sock_puts… that's just how it is, bestie, and we respect the lore 🫢

🌸 SYNOPSIS 🌸

#include <net/socket.h>

size_t sock_puts(SOCKET *s, char *dp);

πŸ’… DESCRIPTION πŸ’…

so the parameter s? that's a descriptor to an open socket, and you get one of those from sock_open(3z) or sock_listen(3z). iconic behaviour honestly.

the sock_puts() function writes the NULL terminated string dp to the socket specified by s. that's the whole vibe. one call, string goes out, main character energy. ✨


πŸŽ€ RETURN VALUE πŸŽ€

the sock_write() function returns the number of bytes written to the socket. slay.

but if you supply an illegal socket? 😭 the carry flag will be set and the return value will be EPROTONOSUPPORT. so like… vibe check failed, protect your peace, check that socket before you send.


πŸ¦‹ SEE ALSO πŸ¦‹

  • sock_write(3z)
  • sock_putc(3z)

πŸ‘‘ AUTHOR πŸ‘‘

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


18 February 2000 β€” that's the date, that's the version stamp, and that's the little sock_puts(3z) footer energy right there. tysm for reading, go write to a socket responsibly, mwah πŸ’œπŸŒˆ

πŸ“¦ where this page comes from