LC_SOCKETPAIR(3) Librecast Programmer's Manual LC_SOCKETPAIR(3)

lc_socketpair - create a pair of connected Librecast sockets

Librecast library (liblibrecast, -llibrecast)

#include <librecast/net.h>
int lc_socketpair(lc_ctx_t *ctx, lc_socket_t *sock[2]);

Compile and link with -llibrecast.

lc_socketpair() creates a pair of connected Librecast sockets.

Call lc_socket_close(3) when done.

Sockets can also be freed by a call to lc_ctx_free(3) on the Librecast context which will free the context and all associated sockets and channels.

On success, zero is returned. On error, -1 is returned, errno is set to indicate the error.

lc_socketpair() can fail with the following errors:

Out of memory. Possibly, the application hit the RLIMIT_AS or RLIMIT_DATA limit described in getrlimit(2).

lc_socketpair() can also fail with any of the errors described in socketpair(2).

lc_socket_new(3), lc_channel_new(3), lc_ctx_new(3), lc_socket_setopt(3), setsockopt(2), socket(2), socketpair(2)

2024-04-08 LIBRECAST