Skip to content

Commit 72dfdc6

Browse files
Corrected user session documentation example (Fixes #1170)
1 parent 6df96fb commit 72dfdc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/server.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,13 +448,13 @@ The session can also be manipulated with the `session()` context manager::
448448
For the ``asyncio`` server, an asynchronous context manager is used::
449449

450450
@sio.event
451-
def connect(sid, environ):
451+
async def connect(sid, environ):
452452
username = authenticate_user(environ)
453453
async with sio.session(sid) as session:
454454
session['username'] = username
455455

456456
@sio.event
457-
def message(sid, data):
457+
async def message(sid, data):
458458
async with sio.session(sid) as session:
459459
print('message from ', session['username'])
460460

0 commit comments

Comments
 (0)