SCTP_SEND(3)

πŸ“¦
version 1.0.21 Β· 3 versions
  • 1.0.21 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 14.5 Β· freebsd 14.5
  • 15.1 Β· freebsd 15.1
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 world
  • len β€” how long that message is
  • sinfo β€” a pointer to a sctp_sndrcvinfo structure. she's carrying the extra info, main character energy fr fr
  • flags β€” this one is a bitwise OR of the flags you'd normally pass as the 3rd argument of a standard sendmsg() 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:


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