lc_socket_new(3)

lc_socket_new3

Create and free librecast sockets

Usage

#include <librecast/net.h>

lc_socket_t *lc_socket_new(lc_ctx_t *ctx); void lc_socket_close(lc_socket_t *sock);

Compile and link with -llibrecast.

Library

Librecast library (liblibrecast, -llibrecast)

Overview

lc_socket_new() creates a new Librecast socket. 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.

lc_socket_free() closes and frees a Librecast socket created with lc_socket_new(3)

Return value

lc_socket_new() returns a pointer to a lc_socket_t handle. On error returns NULL and sets errno.

The lc_socket_close() function returns no value.

Errors

lc_socket_new() 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_socket_new() could also fail with any of the errors listed in socket(2) or setsockopt(2).

Releases

2 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12
  2. 13

From liblibrecast-dev 0.9.1-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.