code: def run(self):
          
          self.log("ready to receive.")
          # we use a runloop instead of synchronous recv so stopping the connection mid-recv is possible
          self.net_socket.settimeout(0.05)
          while self.keep_listening:
              try:
                  packet = self.net_socket.recv(4096)
              except:
                  packet = None
              if packet:
                  packet, source = self._parse_msg(packet)
                  if packet == "PING":
                      self.net_socket.send(b'PONG ' + source + b'\r')
                  elif packet:
                      for mac_addr, recv_queue in self.inq.items():
                          # put the packet in that mac_addr recv queue
                          recv_queue.put(packet)
          self.log('is down.')
docs: runloop that reads incoming packets off the interface into the inq buffer