def stop_receive_thread(self, stop_measurement=False):
        """Stop the receive thread

        Parameters
        ----------
        stop_measurement : bool
            Also stop the measurement.
        """
        if self._recv_thread is not None:
            self._recv_thread.stop()
            self._recv_thread = None

        if stop_measurement:
            self.stop_measurement()
dataset/ETHPy150Open mne-tools/mne-python/mne/realtime/client.py/RtClient.stop_receive_thread/original