'Called from portal when the connection is closed from the
portal side.
Args:
session (PortalSession): Session to disconnect.
delete (bool, optional): Delete the session from
the handler. Only time to not do this is when
this is called from a loop, such as from
self.disconnect_all().'

def disconnect(self, session):

    global _CONNECTION_QUEUE
    if (session in _CONNECTION_QUEUE):
        _CONNECTION_QUEUE.remove(session)
        return
    if ((session.sessid in self) and (not hasattr(self, '_disconnect_all'))):
        del self[session.sessid]
    self.portal.amp_protocol.send_AdminPortal2Server(session, operation=PDISCONN)
