code: def __read(self):
          
          # Set the socket as non-blocking
          self._socket.setblocking(0)
  
          while not self._stop_event.is_set():
              # Watch for content
              ready = select.select([self._socket], [], [], 1)
              if ready[0]:
                  # Socket is ready
                  data, sender = self._socket.recvfrom(1024)
                  try:
                      self._handle_heartbeat(sender, data)
                  except Exception as ex:
                      _logger.exception("Error handling the heart beat: %s", ex)
docs: Reads packets from the socket