LC_SOCKETPAIR(3)

✨ LC_SOCKETPAIR ✨

okay bestie, so this is the lc_socketpair page from the Librecast Programmer's Manual and it's literally about making two sockets that are already obsessed with each other πŸ’–


🌸 NAME 🌸

lc_socketpair β€” create a pair of connected Librecast sockets


πŸ“š LIBRARY πŸ“š

Librecast library (liblibrecast, -llibrecast)


πŸŽ€ SYNOPSIS πŸŽ€

#include <librecast/net.h>

int lc_socketpair(lc_ctx_t *ctx, lc_socket_t *sock[2]);

Compile and link with -llibrecast. no cap, that's the whole thing 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

So like, lc_socketpair() creates a pair of connected Librecast sockets. two of them. a duo. a little matched set. iconic behavior honestly πŸ‘‘

When you're done with them, call lc_socket_close(3). please. do it. don't leave them hanging 😭

Sockets can also be freed by a call to lc_ctx_free(3) on the Librecast context β€” and that one is a full send because it frees the context and all associated sockets and channels. everything goes. clean slate. slay πŸ’…


⭐ RETURN VALUE ⭐

  • On success, zero is returned. πŸŽ‰
  • On error, -1 is returned, and errno is set to indicate the error.

πŸ’€ ERRORS πŸ’€

lc_socketpair() can fail with the following errors:

  • ENOMEM β€” Out of memory. Possibly, the application hit the RLIMIT_AS or RLIMIT_DATA limit described in getrlimit(2). bestie the memory said no πŸ™ˆ

lc_socketpair() can also fail with any of the errors described in socketpair(2). so like, go read that one too, iykyk.


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page!! πŸŽ€ this one's from the LIBRECAST crew, dated 2024-04-08, and it goes by LC_SOCKETPAIR(3) β€” mwah, go make some socket pairs, you got this πŸ’–βœ¨

πŸ“¦ where this page comes from