From bec7d0791699bae0140d960c41ad0d1ff40df51f Mon Sep 17 00:00:00 2001 From: Stephen Brown Date: Sun, 31 May 2020 18:54:56 +0100 Subject: [PATCH] Update server.rst Mentioned that rooms are created in the global default namespace and take an optional argument "namespace" to define the namespace the room is created in. --- docs/server.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/server.rst b/docs/server.rst index 9c28c01..7f1bd73 100644 --- a/docs/server.rst +++ b/docs/server.rst @@ -350,12 +350,17 @@ to the connection. The application is then free to create additional rooms and manage which clients are in them using the :func:`socketio.Server.enter_room` and :func:`socketio.Server.leave_room` methods. Clients can be in as many rooms as needed and can be moved between rooms as often as necessary. +Rooms are created in the default global namespace, but can be directed to a custom namespace with the optional argument :func:`namespace`. :: @sio.event def begin_chat(sid): sio.enter_room(sid, 'chat_users') + + @sio.event + def begin_chat(sid): + sio.enter_room(sid, 'chat_users', namespace='/chat') @sio.event def exit_chat(sid):