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
The issue is that the script immediately crashes as it says clientSocket is not defined when on_connect is called. I believe this is due to the fact that the define method instiantates the class before setting clientSocket to the namespace socket.
If I use socketIO.emit(. . .) inside ClientNamespace the server (nodejs socket.io 1.x) never receives any events in /clients which is what I need it to do. Am I doing something wrong or are there any workarounds?
The text was updated successfully, but these errors were encountered:
I am creating a socket connection as follows:
The issue is that the script immediately crashes as it says
clientSocket
is not defined whenon_connect
is called. I believe this is due to the fact that thedefine
method instiantates the class before settingclientSocket
to the namespace socket.If I use
socketIO.emit(. . .)
insideClientNamespace
the server (nodejs socket.io 1.x) never receives any events in/clients
which is what I need it to do. Am I doing something wrong or are there any workarounds?The text was updated successfully, but these errors were encountered: