lc_socketpair3
Create a pair of connected librecast sockets
Usage
#include <librecast/net.h>
int lc_socketpair(lc_ctx_t *ctx, lc_socket_t *sock[2]);
Compile and link with -llibrecast.
Library
Librecast library (liblibrecast, -llibrecast)
Overview
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.
Return value
On success, zero is returned. On error, -1 is returned, 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_ASorRLIMIT_DATAlimit described in getrlimit(2).
lc_socketpair() can also fail with any of the errors described in socketpair(2).