LC_CHANNEL_SEND(3)

πŸŽ€ LC_CHANNEL_SEND(3) β€” NAME πŸŽ€

okay so welcome to LC_CHANNEL_SEND(3), bestie β€” this is the Librecast Programmer's Manual and we're talking about lc_channel_send, lc_channel_sendmsg, and their whole job, which is: sending data on a Librecast channel πŸ’Œ


πŸ“š LIBRARY

the Librecast library, obviously β€” that's liblibrecast, and you link it with -llibrecast 🫢


✨ SYNOPSIS ✨

#include <librecast/net.h>

ssize_t lc_channel_send(lc_channel_t *chan, const void *buf, size_t len, int flags)
ssize_t lc_channel_sendmsg(lc_channel_t *chan, struct msghdr *msg, int flags);

Compile and link with -llibrecast. πŸ› οΈ


πŸ’– DESCRIPTION πŸ’–

okay so listen. each of these functions sends data over multicast on the librecast channel chan. and here's the vibe: they are analogous to the send(2) and sendmsg(2) calls. like, same energy, same shape, but multicast. iconic behavior honestly πŸ‘‘

so in addition to the usual flags you'd use with send(2) and sendmsg(2), these functions support this one extra flag:

  • MSG_DROP β€” this flag makes the packet get dropped instead of sent. it's used for testing, fr fr. all the normal processing still happens, like encoding and everything, proceeds as usual β€” the only thing skipped is the final send syscall. and the return value? it'll be the number of bytes that would have been sent 🫠✨

πŸ¦‹ RETURN VALUE πŸ¦‹

these calls return the number of bytes received, or -1 if an error occurred 😭 and in the event of an error, errno is set to indicate the error. so check your errno, bestie, always.


πŸ’€ ERRORS πŸ’€

see send(2). that's it, that's the section β€” go look, iykyk πŸ™ˆ


🌈 SEE ALSO 🌈


and that's the whole page, bestie!! this came to you straight from the LIBRECAST manual, dated 2023-08-09 β€” no cap, go forth and multicast responsibly πŸŽ€πŸ’…πŸ¦‹

πŸ“¦ where this page comes from