'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 the lost connection.'

def connectionLost(self, reason):

    self.sessionhandler.disconnect(self)
    self.transport.close()
