Flask - WebSocket and Real-Time
You want to broadcast a notification to all clients except the sender in Flask-SocketIO. Which approach is correct?
include_self=False to exclude the sender when broadcasting.socketio.emit('notify', data, broadcast=True, include_self=False) uses broadcast=True and include_self=False, which is correct. Use socketio.emit('notify', data, broadcast=False) disables broadcast. Use socketio.send('notify', data, broadcast=True) incorrectly passes data as the callback argument to send, causing an error. Use socketio.emit('notify', data) without broadcast sends only to sender.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions