This is in base_manager.py in socket_io python server--> How does this code make any sense? I want to emit a message. How could that ever work if there are no rooms? If namespace not in self.rooms--> there is no room so it will always return back to caller right?:
def emit(self, event, data, namespace, room=None, skip_sid=None,
callback=None):
"""Emit a message to a single client, a room, or all the clients
connected to the namespace."""
if namespace not in self.rooms or room not in self.rooms[namespace]:
return
for sid in self.get_participants(namespace, room):
if sid != skip_sid:
if callback is not None:
id = self._generate_ack_id(sid, namespace, callback)
else:
id = None
self.server._emit_internal(sid, event, data, namespace, id)