LC_RECV(3)

NAME
lc_recvtree, lc_recvchunk - receive data over multicast

LIBRARY
Librecast library (liblibrecast, -llibrecast)

SYNOPSIS
#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.

DESCRIPTION
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).

SEE ALSO
lc_ctx_new(3), lc_share(3), lc_sendtree(3), lc_sendchunk(3)