.TH LC_SEND 3 2023-08-02 "LIBRECAST" "Librecast Programmer's Manual" .SH NAME lc_sendtree, lc_sendchunk \- send data over multicast .SH LIBRARY Librecast library .RI ( liblibrecast ", " \-llibrecast ) .SH SYNOPSIS .nf .B #include .PP .BI "ssize_t lc_sendtree(lc_ctx_t " *lctx ", unsigned char " *hash ", const mtree_t " *tree ", .BI " lc_stat_t " *stats ", lc_sync_options_t " *opt ", int " flags ");" .BI "ssize_t lc_sendchunk(lc_ctx_t " *lctx ", unsigned char " *hash ", const void " *data ", .BI " const size_t " len ", lc_stat_t " *stats ", lc_sync_options_t " *opt ", int " flags ");" .fi .PP Compile and link with \fI\-llibrecast\fP. .SH DESCRIPTION Each of these functions sends data over multicast on the librecast channel formed from the supplied .IR 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. .PP Sending continues in a loop until the calling thread is cancelled. .PP The .BR lc_sendtree function sends the merkle tree structure .IR tree on channel .IR hash . The .BR lc_sendchunk function sends .IR len bytes of .IR data . .PP If .IR stats is not NULL, transfer statistics will be returned in this structure. .PP .IR opt is not used, at present, and must be NULL for compatibility with future versions. .PP The .I flags argument is the bitwise OR of zero of more of the following flags: .TP .BR LC_SHARE_LOOPBACK Set the loopback option .I IPV6_MULTICAST_LOOP on the sending socket. .SH RETURN VALUE These calls return the number of bytes received, or -1 if an error occurred. In the event of an error, .I errno is set to indicate the error. .SH ERRORS .TP .BR EINVAL Invalid argument. .PP .BR ENOMEM Not enough space/cannot allocate memory (POSIX.1-2001). .PP .SH SEE ALSO .BR lc_ctx_new(3), .BR lc_share (3), .BR lc_sendtree (3), .BR lc_sendchunk (3)