lc_recv(3)

lc_recv3

Receive data over multicast

Usage

#include <librecast/sync.h>

ssize_t lc_recvtree(lc_ctx_t *lctx, unsigned char *hash, mtree_t *tree lc_stat_t *stats, lc_sync_options_t *opt, int flags); ssize_t lc_recvchunk(lc_ctx_t *lctx, unsigned char *hash, void *data, const size_t len lc_stat_t *stats, lc_sync_options_t *opt, int flags);

Compile and link with -llibrecast.

Library

Librecast library (liblibrecast, -llibrecast)

Overview

Each of these functions receives data over multicast by joining the librecast channel formed from the supplied hash.

The lc_recvtree function receives the merkle tree structure from channel hash into tree.

The lc_recvchunk function receives a chunk of data of length len (which can be fragmented over several packets) from channel hash, writing it into the memory pointed to by data.

If stats is not NULL, transfer statistics will be returned in this structure.

opt is not used, at present, and must be NULL for compatibility with future versions.

flags is not used, at present, and must be zero for compatibility with future versions.

Return value

These calls return the number of bytes received, or -1 if an error occurred. In the event of an error, errno is set to indicate the error.

Errors

EINVAL

Invalid argument.

ENOMEM Not enough space/cannot allocate memory (POSIX.1-2001).

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