(self, sid, namespace)
Register a client disconnect from a namespace.
Register a client disconnect from a namespace.
Register a client disconnect from a namespace .
def disconnect(self, sid, namespace):
        """Register a client disconnect from a namespace."""
        if namespace not in self.rooms:
            return
        rooms = []
        for room_name, room in self.rooms[namespace].copy().items():
            if sid in room:
                rooms.append(room_name)
        for room in rooms:
            self.leave_room(sid, namespace, room)
        if sid in self.callbacks:
            del self.callbacks[sid]
        if namespace in self.pending_disconnect and \
                sid in self.pending_disconnect[namespace]:
            self.pending_disconnect[namespace].remove(sid)
            if len(self.pending_disconnect[namespace]) == 0:
                del self.pending_disconnect[namespace]
def disconnect ( self , sid , namespace ) : if namespace not in self . rooms : return rooms = [ ] for room_name , room in self . rooms [ namespace ] . copy ( ) . items ( ) : if sid in room : rooms . append ( room_name ) for room in rooms : self . leave_room ( sid , namespace , room ) if sid in self . callbacks : del self . callbacks [ sid ] if namespace in self . pending_disconnect and sid in self . pending_disconnect [ namespace ] : self . pending_disconnect [ namespace ] . remove ( sid ) if len ( self . pending_disconnect [ namespace ] ) == 0 : del self . pending_disconnect [ namespace ]