Пример #1
0
 def send_lowlevel(self, user, data):
     ip = user.get('ip')
     port = user.get('port')
     if ip == None or port == None:
         warning('fetcher: No ip/port to open %s\n' % (user.tag()))
         return
     send_broadcast(ip, port, data)
Пример #2
0
    def broadcast(self, msg):
        if not self.get_network_state(self.IP_NETWORK):
            # Act like there is no IP network
            return

        for (dev, state) in self.net.get_interfaces().items():
            (ip, bcast) = state
            if ip == None:
                continue
            for port in get_broadcast_ports():
                send_broadcast(bcast, port, msg)