def shutdown(self, callback=None):

        if self.socket:
            self._reader = None
            if callback:
                self._close_callback = callback
            if self._wb:
                self._write_callback = self.close
            else:
                self.close()
        return self
Close this stream once the write buffer is emptied and
dataset/ETHPy150Open HenryHu/pybbs/xmpp/readstream.py/ReadStream.shutdown