I want to print something when a client disconnected, but this isn't working
Javascript client:
socket.on("connect", () => {
socket.on("disconnect", () => {
socket.emit("disconnected", "{{room_num}}")
})
})
Python flask :
@socketio.on("disconnected")
def handle_disconnect(room_num):
print(f"user in room {room_num} disconnected")
Turns out its impossible to emit something when disconnected to I just ended up using request.sid
to identify different disconnected clients.