ROAR_SOCKET_NONBLOCK(3)

πŸ“¦ version 1.0~beta12, in ubuntu jammy

πŸ’– roar_socket_nonblock β€” it's in section 3 of the System Manager's Manual, bestie, and it's giving RoarAudio πŸ’–

okay so picture this: you've got a socket, right? and it's just sitting there being all blocking and dramatic, and you're like "girl, I do not have time to wait for you." That's literally this function. roar_socket_nonblock flips the blocking state of a socket and it's so simple it's honestly iconic. ✨


🌸 SYNOPSIS 🌸

#include <roaraudio.h>

int roar_socket_nonblock(int fh, int state);

two args, one int back, no drama. we love a low-maintenance queen. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So what does it actually do? It sets the blocking mode of a given filehandle. That's it, that's the whole vibe. 🫢

If you're sitting there like "bestie what even IS nonblocking IO," no worries, the original author said it best: go read open(2) and look for O_NONBLOCK. That's the lore. πŸ“–βœ¨


πŸŽ€ PARAMETERS πŸŽ€

  • fh β€” the filehandle you're setting the new state on. hand it over, she's getting a glow-up. πŸ’–
  • state β€” the new state you want, and you've got exactly two moods to pick from:
    • ROAR_SOCKET_BLOCK β€” sets blocking mode. back to the old ways, she waits. 😴
    • ROAR_SOCKET_NONBLOCK β€” sets nonblocking mode. main character energy, no waiting around. πŸ”₯
    • and just so we're clear, ROAR_SOCKET_NONBLOCK is the same as setting O_NONBLOCK within open(2). same energy, different spelling. iykyk. πŸ’œ

πŸ‘‘ RETURN VALUE πŸ‘‘

  • on success β€” these calls return 0. slay. ✨
  • on error β€” -1 is returned. not slay. 😭
fr fr, always check that return value. -1 is the group chat notification you do NOT want to ignore. πŸ’€

🌈 EXAMPLES 🌈

FIXME

yeah bestie the examples section literally just says FIXME 😭 the maintainers left us on read. not me being obsessed with a TODO though. πŸ™ˆ


πŸ“ SEE ALSO πŸ“

go read these, they're the supporting cast and they ate. πŸ’…πŸŒΈ


RoarAudio ✨ May 2011 β€” that's the source, the version, and the date, and yes we're closing this out like a signature on a love letter. mwah. πŸ’–πŸŽ€πŸ¦‹πŸ§šβ­

πŸ“¦ where this page comes from