Socket...icast6(3pm)
β¨ Socket::Multicast6 β bestie edition β¨
okay so this is Socket::Multicast6, a lil Perl module from the User Contributed Perl Documentation section (it lives in the 3pm manpage zone π
). Think of it as your little toolbox for β¨multicast socket operationsβ¨ on both IPv4 and IPv6. Constants? Got 'em. Constructor helpers? Got those too. Let's get into it π¦
πΈ NAME πΈ
Socket::Multicast6 β Constructors and constants for IPv4 and IPv6 multicast socket operations.
π SYNOPSIS π
use Socket::Multicast6 qw(:all);
my $ip = getprotobyname( 'ip' );
my $ip_mreq = pack_ip_mreq( inet_aton( $mcast_addr ), inet_aton( $if_addr ) );
my $ipv6_mreq = pack_ipv6_mreq( inet_pton( AF_INET6, $mcast6_addr ), $if_index );
setsockopt( $sock, $ip, IP_ADD_MEMBERSHIP, $ip_mreq )
or die( "setsockopt IP_ADD_MEMBERSHIP failed: $!" );
setsockopt( $sock, $ip, IP_DROP_MEMBERSHIP, $ip_mreq )
or die( "setsockopt IP_DROP_MEMBERSHIP failed: $!" );
setsockopt( $sock, $ip, IP_MULTICAST_LOOP, pack( 'C', $loop ) )
or die( "setsockopt IP_MULTICAST_LOOP failed: $!" );
setsockopt( $sock, $ip, IP_MULTICAST_TTL, pack( 'C', $ttl ) )
or die( "setsockopt IP_MULTICAST_TTL failed: $!" );
likeβ¦ look at that. setsockopt with or die(...) every single time because we do NOT ignore errors in this house π€β¨
π DESCRIPTION π
So what's the deal with this module? It's your all-access pass ποΈ β it gives you the constants and utility functions you need when you're messing with multicast socket attributes. That's it. That's the whole vibe.
And here's the tea β β if you want a simple, object-oriented way of doing the exact same thing, go peek at IO::Socket::Multicast6 or IO::Socket::Multicast. They're giving convenience. They're giving main character energy. iykyk π
π«Ά EXPORTS π«Ά
By default? Nothing. Zero. Nada. π
But bestie, you have options:
- use
'ipv4'to export a specific protocol family - use
'ipv6'to export a specific protocol family - use
'independent'to export a specific protocol family - use
'all'to export all the symbols π
π§ FUNCTIONS π§
$ip_mreq = pack_ip_mreq(MCAST_ADDR, IF_ADDR)β packs up anip_mreqstruct for you, from the multicast address and the interface address π$ip_mreq_source = pack_ip_mreq_source(MCAST_ADDR, SOURCE_ADDR, IF_ADDR)β same energy but with a source address in the mix (three args, no skimping) β¨$ipv6_mreq = pack_ipv6_mreq(MCAST6_ADDR, IF_INDEX)β the IPv6 version, takes the multicast address plus an interface index (yes, an index, not an address, don't come for me) π¦
π CONSTANTS π
Here's the full roster, no one left behind, periodt:
IP_MULTICAST_IFIP_MULTICAST_TTLIP_MULTICAST_LOOPIP_ADD_MEMBERSHIPIP_DROP_MEMBERSHIPIP_ADD_SOURCE_MEMBERSHIPIP_DROP_SOURCE_MEMBERSHIPIPV6_MULTICAST_IFIPV6_MULTICAST_HOPSIPV6_MULTICAST_LOOPIPV6_JOIN_GROUPIPV6_LEAVE_GROUPMCAST_JOIN_GROUPMCAST_BLOCK_SOURCEMCAST_UNBLOCK_SOURCEMCAST_LEAVE_GROUPMCAST_JOIN_SOURCE_GROUPMCAST_LEAVE_SOURCE_GROUP
eighteen icons, all accounted for π
π SEE ALSO π
IO::Socket::Multicast6β (The easier, object-oriented way) π«Ά genuinely, if you want the chill route, this is it
π AUTHOR π
Based on Socket::Multicast by Jonathan Steinert, <hachi@cpan.org>
Socket::Multicast6 by Nicholas J Humfrey, <njh@cpan.org>
π COPYRIGHT AND LICENSE π
Copyright (C) 2006 Nicholas J Humfrey Copyright (C) 2006 Jonathan Steinert
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6.1 or, at your option, any later version of Perl 5 you may have available.
and that's the whole page, bestie!! π this lil gem dropped as perl v5.42.3 and it's dated 2026-08-20 β so go forth, join your multicast groups, pack your mreqs, and slay π
β¨π¦
π¦ where this page comes from
- ubuntu stonking: libsocket-multicast6-perl 0.04-5build5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms