lc_socketpair - create a pair of connected Librecast sockets
Contents
Description
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.
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).
lc_socketpair() can also fail with any of the errors described in socketpair(2).
Library
Librecast library (liblibrecast, -llibrecast)
Name
lc_socketpair - create a pair of connected Librecast sockets
Return Value
On success, zero is returned. On error, -1 is returned, errno is set to indicate the error.
See Also
lc_socket_new(3), lc_channel_new(3), lc_ctx_new(3), lc_socket_setopt(3), setsockopt(2), socket(2), socketpair(2) LIBRECAST 2024-04-08 LC_SOCKETPAIR(3)
Synopsis
#include<librecast/net.h>intlc_socketpair(lc_ctx_t*ctx,lc_socket_t*sock[2]);
Compile and link with -llibrecast.
