lc_recvtree, lc_recvchunk - receive data over multicast
Contents
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.
Errors
EINVAL Invalid argument.
ENOMEM Not enough space/cannot allocate memory (POSIX.1-2001).
Library
Librecast library (liblibrecast, -llibrecast)
Name
lc_recvtree, lc_recvchunk - receive data over multicast
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.
See Also
lc_ctx_new(3),lc_share(3), lc_sendtree(3), lc_sendchunk(3) LIBRECAST 2023-08-02 LC_RECV(3)
Synopsis
#include<librecast/sync.h>ssize_tlc_recvtree(lc_ctx_t*lctx,unsignedchar*hash,mtree_t*treelc_stat_t*stats,lc_sync_options_t*opt,intflags);ssize_tlc_recvchunk(lc_ctx_t*lctx,unsignedchar*hash,void*data,constsize_tlenlc_stat_t*stats,lc_sync_options_t*opt,intflags);
Compile and link with -llibrecast.
