Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not broadcasting in room in example #1441

Closed
lerefor opened this issue Dec 19, 2020 · 1 comment · Fixed by RC-MODULE/rumboot-tools#12
Closed

not broadcasting in room in example #1441

lerefor opened this issue Dec 19, 2020 · 1 comment · Fixed by RC-MODULE/rumboot-tools#12

Comments

@lerefor
Copy link

lerefor commented Dec 19, 2020

Fix a little bug in app.py

@socketio.event
def my_room_event(message):
session['receive_count'] = session.get('receive_count', 0) + 1
emit('my_response', {'data': message['data'], 'count': session['receive_count']}, to=message['room'])

should be

@socketio.event
def my_room_event(message):
session['receive_count'] = session.get('receive_count', 0) + 1
emit('my_response', {'data': message['data'], 'count': session['receive_count']}, to=message['room'], broadcast=True)

in order to broadcast the msg to all room users

@miguelgrinberg
Copy link
Owner

The fix was a bit more involved than what you suggested, but it should be working ow. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants