The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Socket::Multicast - Constructors and constants for multicast socket operations.

SYNOPSIS

use Socket::Multicast qw(:all);

my $ip = getprotobyname( 'ip' );

my $ip_mreq = pack_ip_mreq( inat_aton( $mcast_addr ), inet_aton( $if_addr ) );

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: $!" );

DESCRIPTION

This module is used to gain access to constants and utility functions used when manipulating multicast socket attributes. This module allows you to do the same things as IO::Socket::Multicast, but this is the long way.

FUNCTIONS

IP_MREQ = pack_ip_mreq MCAST_ADDR, IF_ADDR

CONSTANTS

IP_MULTICAST_IF

IP_MULTICAST_TTL

IP_MULTICAST_LOOP

IP_ADD_MEMBERSHIP

IP_DROP_MEMBERSHIP

SEE ALSO

IO::Socket::Multicast (The fast way)

AUTHOR

Jonathan Steinert, <hachi@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2006 by 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.8.8 or, at your option, any later version of Perl 5 you may have available.