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


Socket-Multicast documentation  | view source Contained in the Socket-Multicast distribution.

Index


NAME

Top

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

SYNOPSIS

Top

  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

Top

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

Top

IP_MREQ = pack_ip_mreq MCAST_ADDR, IF_ADDR

CONSTANTS

Top

IP_MULTICAST_IF

IP_MULTICAST_TTL

IP_MULTICAST_LOOP

IP_ADD_MEMBERSHIP

IP_DROP_MEMBERSHIP

SEE ALSO

Top

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

AUTHOR

Top

Jonathan Steinert, <hachi@cpan.org>

COPYRIGHT AND LICENSE

Top


Socket-Multicast documentation  | view source Contained in the Socket-Multicast distribution.