File: lc_send.3

package info (click to toggle)
librecast 0.11.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,760 kB
  • sloc: ansic: 31,144; asm: 28,570; sh: 3,164; makefile: 713; python: 70
file content (83 lines) | stat: -rw-r--r-- 2,307 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
.TH LC_SEND 3 2025-06-09 "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 <librecast/sync.h>
.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 ");"
.BI "ssize_t lc_senddir(lc_ctx_t " *lctx ", unsigned char " *hash ", net_tree_t " *dir ",
.BI "        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
The
.BR lc_senddir
function is a wrapper for
.BR lc_sendtree (3)
which sends a directory object and adjusts the sending size to account for the
directory 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)