(self)
Join multicast group on the chosen interface
Join multicast group on the chosen interface
Join multicast group on the chosen interface
def _join_mcast_group(self):
        """Join multicast group on the chosen interface"""
        if (self.ifindex != 0):
            logger.debug("Join multicast group %s on network interface %d" %
                         (self.ip, self.ifindex))
        else:
            logger.debug("Join group %s with the default network interface" %
                         (self.ip))

        ip_mreqn = struct.pack('4s4si', socket.inet_aton(self.ip),
                               socket.inet_aton('0.0.0.0'), self.ifindex)
        self.sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP,
                             ip_mreqn)

        # Make sure that this socket receives messages solely from the above
        # group that was explicitly joined above
        self.sock.setsockopt(socket.IPPROTO_IP, IP_MULTICAST_ALL, 0)
def _join_mcast_group ( self ) : if ( self . ifindex != 0 ) : logger . debug ( "Join multicast group %s on network interface %d" % ( self . ip , self . ifindex ) ) else : logger . debug ( "Join group %s with the default network interface" % ( self . ip ) ) ip_mreqn = struct . pack ( '4s4si' , socket . inet_aton ( self . ip ) , socket . inet_aton ( '0.0.0.0' ) , self . ifindex ) self . sock . setsockopt ( socket . IPPROTO_IP , socket . IP_ADD_MEMBERSHIP , ip_mreqn ) # Make sure that this socket receives messages solely from the above # group that was explicitly joined above self . sock . setsockopt ( socket . IPPROTO_IP , IP_MULTICAST_ALL , 0 )