def serviceStopped(self):
        """
        Called when the connection is stopped.
        """
        # Close any fully open channels
        for channel in list(self.channelsToRemoteChannel.keys()):
            self.channelClosed(channel)
        # Indicate failure to any channels that were in the process of
        # opening but not yet open.
        while self.channels:
            (_, channel) = self.channels.popitem()
            log.callWithLogger(channel, channel.openFailed,
                               twisted.internet.error.ConnectionLost())
        # Errback any unfinished global requests.
        self._cleanupGlobalDeferreds()

        Called when the connection is stopped.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/ssh/connection.py