handle reconnects correctly
This commit is contained in:
parent
070a60a272
commit
a5cfccbdfc
@ -123,10 +123,12 @@ class ConnectionHandler(object):
|
|||||||
conn = self.reconnect_session(socket, msg['data']['id'])
|
conn = self.reconnect_session(socket, msg['data']['id'])
|
||||||
if conn is not None:
|
if conn is not None:
|
||||||
self._add_connection(conn)
|
self._add_connection(conn)
|
||||||
await conn.send(json.dumps({
|
await socket.send(json.dumps({
|
||||||
"type": "reconnect_response",
|
"type": "reconnect_response",
|
||||||
"data": {
|
"data": {
|
||||||
"success": True,
|
"success": True,
|
||||||
|
"id": conn.id,
|
||||||
|
"user": conn.user_name,
|
||||||
"msg": ""
|
"msg": ""
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
@ -135,6 +137,8 @@ class ConnectionHandler(object):
|
|||||||
"type": "reconnect_response",
|
"type": "reconnect_response",
|
||||||
"data": {
|
"data": {
|
||||||
"success": False,
|
"success": False,
|
||||||
|
"id": conn.id,
|
||||||
|
"user": conn.user_name,
|
||||||
"msg": "session not available"
|
"msg": "session not available"
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
Loading…
Reference in New Issue
Block a user