code: def stream_end(self):
          
          logger.debug("Stream ended")
          with self.lock:
              self._input_state = "closed"
              self.transport.disconnect()
              self._output_state = "closed"
docs: Process </stream:stream> (stream end) tag received from peer.