'When the channel closes, deliver disconnection notification to the
protocol.'

def closed(self):

    self._creator.cleanupConnection(self.conn, False)
    if (self._reason is None):
        reason = ConnectionDone('ssh    channel    closed')
    else:
        reason = self._reason
    self._protocol.connectionLost(Failure(reason))
