You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've setup the libraries as instructed (installed the Ubuntu dependencies, installed django_socketio via PIP, added in the URLconf, put django_socketio into my settings.py's INSTALLED_APPS and run manage.py collectstatic). I'm not a Django notice and I've worked with socket.io before, but I'm utterly stumped!
Client-side things seem to be OK: a socket connection is established and the connect event is called; same for `disconnect, however no events fire at all on the server side.
In my models.py file, I've hooked up a function to the on_connect, on_subscribe and on_message events and none of them run (I've discovered this by setting up logging. A log entry is written and output to the console that confirms the code is being run that hooks up the events, but nothing ever happens when the events take place).
Is this an issue with latter versions of the Websockets protocol as mentioned in your docs? I'm running the socket server as sudo (tried in daemon and shell mode), but I get nothing either way.
Any ideas?
Thanks!
The text was updated successfully, but these errors were encountered:
I've had the same problem. I believe the problem is a bug in django-socketio when there isn't a channel supplied to the decorator.
In views.py Line 38: https://github.com/stephenmcd/django-socketio/blob/master/django_socketio/views.py#L38
The socket subscribes to a channel and then calls the on_subscribe callback handler. The problem is that in events.py on Line 65: https://github.com/stephenmcd/django-socketio/blob/master/django_socketio/events.py#L65
there is a check not socket.channels. Well, we just subscribed to a channel, so that will always return False. If there isn't a channel pattern given ( i.e. the default decorator ), then no_channel will always be False and the handler will never get called at Line 71, events.py. I'm really not even certain that the no_channel variable needs to be there. It seems to me that the check for socket.channel comes later on anyway on Line 69 in events.py.
I've setup the libraries as instructed (installed the Ubuntu dependencies, installed
django_socketio
via PIP, added in the URLconf, putdjango_socketio
into my settings.py'sINSTALLED_APPS
and runmanage.py collectstatic
). I'm not a Django notice and I've worked with socket.io before, but I'm utterly stumped!Client-side things seem to be OK: a socket connection is established and the
connect
event is called; same for `disconnect, however no events fire at all on the server side.In my models.py file, I've hooked up a function to the
on_connect
,on_subscribe
andon_message
events and none of them run (I've discovered this by setting up logging. A log entry is written and output to the console that confirms the code is being run that hooks up the events, but nothing ever happens when the events take place).Is this an issue with latter versions of the Websockets protocol as mentioned in your docs? I'm running the socket server as sudo (tried in daemon and shell mode), but I get nothing either way.
Any ideas?
Thanks!
The text was updated successfully, but these errors were encountered: