SCTP_SEND(3)
π SCTP_SEND π
okay bestie, gather round, because we're talking about sctp_send from the Linux Programmer's Manual, section 3 (that's the library-functions girlies, iykyk) π«Ά
β¨ NAME β¨
sctp_send β send a message from a SCTP socket. that's it, that's the job π
πΈ SYNOPSIS πΈ
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/sctp.h>
int sctp_send(int sd, const void * msg, size_t len,
const struct sctp_sndrcvinfo *sinfo,
uint32_t flags);
like, look at her. she's so clean. no cap. β¨
π¦ DESCRIPTION π¦
so sctp_send is a wrapper library function, and the whole point of her existence is that you can send a message from a socket without having to mess with the CMSG header structures. the way that you get to skip all that scaffolding?? iconic. no notes. π
here's the breakdown, bestie:
sdβ the socket descriptor, aka the one you're sending from πmsgβ a pointer to the message itself, the actual thing getting yeeted out into the worldlenβ how long that message issinfoβ a pointer to asctp_sndrcvinfostructure. she's carrying the extra info, main character energy fr frflagsβ this one is a bitwise OR of the flags you'd normally pass as the 3rd argument of a standardsendmsg()call π₯
so basically: sd, msg, len, sinfo, flags, boom, message sent, slay. that's the whole vibe. π
β RETURN VALUE β
on success, sctp_sendmsg returns the number of bytes sent. and if something went wrong? she hits you with the -1. π that's the error signal, bestie, don't ignore her.
π SEE ALSO π
go read these too, they're all in the same friend group:
sctp(7)sctp_bindx(3)sctp_recvmsg(3)sctp_recvv(3)sctp_peeloff(3)sctp_getpaddrs(3)sctp_getladdrs(3)sctp_opt_info(3)sctp_sendmsg(3)sctp_sendv(3)
ngl the whole squad is here. go forth and send your messages. π
mwah π this page came from the Linux 2.6 era, dated 2005-10-25, and she's still serving. periodt.
π¦ where this page comes from
- alpine 3.22: lksctp-tools-doc 1.0.19-r5 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- alpine 3.23: lksctp-tools-doc 1.0.19-r5 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- alpine 3.24: lksctp-tools-doc 1.0.19-r5 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- arch rolling: lksctp-tools 1.0.21-1 Β· GPL-2.0-or-later AND LGPL-2.1-only
- centos-stream 10: lksctp-tools-devel 1.0.21-1.el10 Β· GPLv2 and GPLv2+ and LGPLv2 and MIT
- centos-stream 9: lksctp-tools-devel 1.0.19-2.el9 Β· GPLv2 and GPLv2+ and LGPLv2 and MIT
- centos-stream 9: lksctp-tools-devel 1.0.19-2.el9 Β· GPLv2 and GPLv2+ and LGPLv2 and MIT
- debian bookworm: libsctp-dev 1.0.19+dfsg-2 Β· GPL-2.0-or-later
- debian trixie: libsctp-dev 1.0.21+dfsg-1 Β· GPL-2.0-or-later
- fedora 43: lksctp-tools-devel 1.0.21-1.fc43 Β· GPL-2.0-or-later AND LGPL-2.0-only AND MIT
- fedora 43: lksctp-tools-devel 1.0.21-1.fc43 Β· GPL-2.0-or-later AND LGPL-2.0-only AND MIT
- fedora 44: lksctp-tools-devel 1.0.21-3.fc44 Β· GPL-2.0-or-later AND LGPL-2.0-only AND MIT
- fedora 44: lksctp-tools-devel 1.0.21-3.fc44 Β· GPL-2.0-or-later AND LGPL-2.0-only AND MIT
- nixos 26.05: lksctp-tools 1.0.21
- nixpkgs unstable: lksctp-tools 1.0.21
- opensuse-leap 16.0: lksctp-tools-devel 1.0.21-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: lksctp-tools-devel 1.0.21-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: lksctp-tools-devel 1.0.21-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: lksctp-tools-devel 1.0.21-160000.3.2 Β· LGPL-2.1-or-later
- ubuntu jammy: libsctp-dev 1.0.19+dfsg-1build1 Β· GPL-2.0-or-later
- ubuntu noble: libsctp-dev 1.0.19+dfsg-2build1 Β· GPL-2.0-or-later
- ubuntu questing: libsctp-dev 1.0.21+dfsg-1build1
- ubuntu resolute: libsctp-dev 1.0.21+dfsg-1build2 Β· GPL-2.0-or-later
- ubuntu stonking: libsctp-dev 1.0.21+dfsg-2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms