Socket::Linux(3pm)

πŸ’– Socket::Linux β€” the vibe

okay so bestie, welcome to Socket::Linux, a lil Perl module from the User Contributed Perl Documentation section of the manual. she's giving "socket constants defined in Linux <netinet/tcp.h>" and honestly? iconic. πŸŽ€


✨ NAME ✨

Socket::Linux β€” this whole module is basically a little gift bag 🎁 of socket constants that live in the Linux <netinet/tcp.h> header. that's the whole assignment. she said "I only do one thing and I do it slay." πŸ’…


🌸 SYNOPSIS 🌸

here's how you pull up, fr fr:

use Socket qw(IPPROTO_TCP);
use Socket::Linux qw(TCP_KEEPINTVL TCP_KEEPIDLE TCP_KEEPCNT);

setsockopt($sock, IPPROTO_TCP, TCP_KEEPIDLE,  10);
setsockopt($sock, IPPROTO_TCP, TCP_KEEPINTVL, 10);
setsockopt($sock, IPPROTO_TCP, TCP_KEEPCNT,    3);

look at that. import the constants, pass them to setsockopt with IPPROTO_TCP as the level, and the kernel knows exactly what you mean. no guessing, no magic numbers floating around your codebase like they own the place. πŸ’œ


πŸ¦‹ DESCRIPTION πŸ¦‹

Socket::Linux exports to perl the constants defined in Linux <netinet/tcp.h>. 🌈

that's it. that's the tea. these are the TCP-level knobs β€” the ones that live under IPPROTO_TCP β€” and Linux defines a bunch of them in a C header that perl doesn't know about out of the box, so this module scoops them up and hands them to you by name. no cap. ✨


πŸ‘‘ SEE ALSO πŸ‘‘

go say hi to all three, they're all serving. πŸ’–


πŸ’œ AUTHOR πŸ’œ

Salvador FandiΓ±o (sfandino@yahoo.com) β€” thank you for your service, king. 🫢


Copyright (C) 2010 by Qindel FormaciΓ³n y Servicios SL.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.

so basically: free software, same terms as Perl, 5.10.1 or literally anything newer that you've got. go off. πŸ’…

and that's the whole page, bestie!! πŸ¦‹ this one shipped as part of perl v5.42.3, dated 2026-08-19, and it's still out here doing exactly one thing perfectly. periodt. πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from