Is there any way to get all the rooms?
Yes, you could.
To get all the rooms,
sio_serverobj.manager.rooms
This should be a dict of namespace, rooms pair. To get only the room names of all namesapces, you could try the below code.
rooms = []
for ns, rinfo in sio_serverobj.manager.rooms.items():
rooms.extend(rinfo.keys())
print(rooms)
To get rooms specific to a particular namespace,
serverobj.manager.rooms[ns].keys()
To get all the rooms where your client (sid) was attached to.
sio_serverobj.rooms(sid, namespace=None)
This is accessing the internals of this package, which are subject to change at any time. I make no guarantees that this is going to be preserved in future releases.
The list of rooms is actually not provided, because when you scale the server to multiple workers it is not trivial to obtain the full list. The application is actually in a much better position to keep track of the active rooms, maybe in a database, something this package does not have access to.