lc_sendtree, lc_sendchunk - send data over multicast
Contents
Description
Each of these functions sends data over multicast on the librecast channel formed from the supplied hash.
LCRQ (RaptorQ) encoding is used when sending. Trees, for which the length is not known by the receiver,
include an OTI header (RaptorQ FEC Object Transmission Information header - see RFC 6330) with each
packet.
Sending continues in a loop until the calling thread is cancelled.
The lc_sendtree function sends the merkle tree structure tree on channel hash. The lc_sendchunk function
sends len bytes of 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.
The flags argument is the bitwise OR of zero of more of the following flags:
LC_SHARE_LOOPBACK
Set the loopback option IPV6_MULTICAST_LOOP on the sending socket.
Errors
EINVAL Invalid argument.
ENOMEM Not enough space/cannot allocate memory (POSIX.1-2001).
Library
Librecast library (liblibrecast, -llibrecast)
Name
lc_sendtree, lc_sendchunk - send 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_SEND(3)
Synopsis
#include<librecast/sync.h>ssize_tlc_sendtree(lc_ctx_t*lctx,unsignedchar*hash,constmtree_t*tree,lc_stat_t*stats,lc_sync_options_t*opt,intflags);ssize_tlc_sendchunk(lc_ctx_t*lctx,unsignedchar*hash,constvoid*data,constsize_tlen,lc_stat_t*stats,lc_sync_options_t*opt,intflags);
Compile and link with -llibrecast.
