MCPcopy Create free account
hub / github.com/miguelgrinberg/python-socketio / enter_room

Method enter_room

src/socketio/server.py:272–286  ·  view source on GitHub ↗

Enter a room. This function adds the client to a room. The :func:`emit` and :func:`send` functions can optionally broadcast events to all the clients in a room. :param sid: Session ID of the client. :param room: Room name. If the room does not exist it is cr

(self, sid, room, namespace=None)

Source from the content-addressed store, hash-verified

270 else None
271
272 def enter_room(self, sid, room, namespace=None):
273 """Enter a room.
274
275 This function adds the client to a room. The :func:`emit` and
276 :func:`send` functions can optionally broadcast events to all the
277 clients in a room.
278
279 :param sid: Session ID of the client.
280 :param room: Room name. If the room does not exist it is created.
281 :param namespace: The Socket.IO namespace for the event. If this
282 argument is omitted the default namespace is used.
283 """
284 namespace = namespace or '/'
285 self.logger.info('%s is entering room %s [%s]', sid, room, namespace)
286 self.manager.enter_room(sid, namespace, room)
287
288 def leave_room(self, sid, room, namespace=None):
289 """Leave a room.

Callers 15

test_enter_roomMethod · 0.95
admin_enter_roomMethod · 0.45
admin_enter_roomMethod · 0.45
test_enter_roomMethod · 0.45
enter_roomFunction · 0.45
test_disconnectMethod · 0.45
test_disconnect_allMethod · 0.45
test_close_roomMethod · 0.45
test_roomsMethod · 0.45
test_emit_to_roomMethod · 0.45
test_emit_to_roomsMethod · 0.45

Calls

no outgoing calls

Tested by 15

test_enter_roomMethod · 0.76
test_enter_roomMethod · 0.36
enter_roomFunction · 0.36
test_disconnectMethod · 0.36
test_disconnect_allMethod · 0.36
test_close_roomMethod · 0.36
test_roomsMethod · 0.36
test_emit_to_roomMethod · 0.36
test_emit_to_roomsMethod · 0.36
test_emit_to_allMethod · 0.36