code: def _ping(self) -> bool:
          
          assert self.socket is not None
          resp = None
          try:
              self.socket.sendall(b"PINGPING")
              resp = self.socket.recv(8)
          except Exception:
              pass
          return resp == b"PONGPONG"
docs: Test if the device is listening.