def stopService(self):
        super(ClientService, self).stopService()
        self._stopRetry()
        self._stopRetry = _noop
        self._connectionInProgress.cancel()
        self._loseConnection()
        self._currentConnection = None
        def finishStopping(result):
            if not self.running:
                self._stopped = True
                self._unawait(Failure(CancelledError()))
            return None
        return (gatherResults([self._connectionInProgress, self._lostDeferred])
                .addBoth(finishStopping))
Serializes all states into json form.
dataset/ETHPy150Open twisted/twisted/twisted/application/internet.py/ClientService.stopService--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/appengine-mapreduce/python/src/mapreduce/datastore_range_iterators.py/RangeIterator.to_json