socket_sctp4(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– socket_sctp4 β€” bestie edition πŸ’–

okay so this one lives in the Library Functions Manual, and it's a lil function from libowfat called socket_sctp4, and I need you to know it's iconic before we even get into it. sit down, grab a boba, we're doing sockets πŸ§‹βœ¨


🌸 NAME 🌸

socket_sctp4 β€” makes you a non-blocking SCTP/IP stream socket πŸ¦‹

like. it literally just. spawns one. for you. no cap.


✨ SYNTAX ✨

#include <libowfat/socket.h>

int socket_sctp4();

that's it bestie, no arguments, no nothing, she takes zero parameters and she serves πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea: socket_sctp4 creates a non-blocking SCTP/IP stream socket, and it hands you back a file descriptor pointing right at it. that fd is your new best friend, treat her well 🫢

and if something goes wrong? if the universe simply said "not today"? then socket_sctp4 returns -1, sets errno appropriately so you know exactly what went down, and β€” this is the important part β€” it does all that without allocating any resources. no leaked anything. clean exit. we love a function that doesn't leave a mess behind πŸ’€βœ¨

ngl, always check that return value. -1 means go read errno, periodt.

🌈 EXAMPLE 🌈

here's how the girlies actually use her:

#include <libowfat/socket.h>

int s;
char ip[4];
uint16 p;

s = socket_sctp4();
socket_bind4(s,ip,p);
socket_connect4(s,ip,p);

make the socket, bind her to an address, connect her to a peer. the full main character arc, start to finish πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

go read those too, iykyk πŸ“š


that's the whole page bestie!! this was socket_sctp4(3) from the Library Functions Manual, and yes she ate and left no crumbs. mwah, go build something cute πŸ’œπŸŽ€