'This is executed when the connection is lost for whatever
reason. It can also be called directly, from the disconnect
method.
Args:
reason (str): Motivation for loosing connection.'

def connectionLost(self, reason=None):

    insults.TerminalProtocol.connectionLost(self, reason)
    self.sessionhandler.disconnect(self)
    self.terminal.loseConnection()
