def close(self):

        if self.socket:
            if __debug__: log.debug('CLOSE')
            self.io.remove_handler(self.socket.fileno())
            self.socket.close()
            self.socket = None
            self._close_callback and self._close_callback()
        return self
Immediately close the stream.
dataset/ETHPy150Open HenryHu/pybbs/xmpp/readstream.py/ReadStream.close