---
name: "lc_channel_sendmsg"
section: "3"
platform: "linux"
package: "liblibrecast-dev"
version: "0.9.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/lc_channel_send"
---

# lc\_channel\_sendmsg(3)

send data on a Librecast channel

Part of [lc\_channel\_send(3)](/lc_channel_send/3.md).

## NAME

lc\_channel\_send, lc\_channel\_sendmsg - send data on a Librecast channel

## LIBRARY

Librecast library (*liblibrecast*, *-llibrecast*)

## SYNOPSIS

```
#include <librecast/net.h>
```

**ssize\_t lc\_channel\_send(lc\_channel\_t** *\*chan***, const void** *\*buf***, size\_t** *len***, int** *flags***)** **ssize\_t lc\_channel\_sendmsg(lc\_channel\_t** *\*chan***, struct msghdr** *\*msg***, int** *flags***);**

Compile and link with *-llibrecast*.

## DESCRIPTION

Each of these functions sends data over multicast on the librecast channel *chan*. They are analogous to the [**send**(2)](/send/2.md) and [**sendmsg**(2)](/sendmsg/2.md) calls.

In addition to the usual flags used with [**send**(2)](/send/2.md) and [**sendmsg**(2)](/sendmsg/2.md) these functions support the following flags:

- **MSG\_DROP**

  This flag causes the packet to be dropped instead of sending. It is used for testing. All normal processing, such as encoding proceeds as usual. Only the final send syscall is skipped. The return value will be the number of bytes that would have been sent.

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

See [**send**(2)](/send/2.md).

## SEE ALSO

**[lc\_ctx\_new(3)](/lc_ctx_new/3.md),** **lc\_channel\_new**(3), [**send**(2)](/send/2.md), [**sendmsg**(2)](/sendmsg/2.md)
