So, suppose we have a server:
class Ns(socketio.Namespace):
def on_connect(self, sid, environ):
logging.info("Ns: on_connect is triggered")
def on_some_event(self, sid, data):
logging.info("Ns: some event is triggered")
class RootNs(socketio.Namespace):
def on_connect(self, sid, environ):
logging.info("RootNs: on_connect is triggered")
sio.register_namespace(Ns("/ns"))
sio.register_namespace(RootNs("/"))
...
And simple client:
sio = socketio.Client()
sio.connect("<server_url>")
sio.emit("some_event", namespace="/ns")
And the server log is:
RootNs: on_connect is triggered
Ns: some event is triggered
Is this a correct behavior? I think the client should connect to a namespace before emitting any event to it. Maybe I misunderstand something?
So, suppose we have a server:
And simple client:
And the server log is:
Is this a correct behavior? I think the client should connect to a namespace before emitting any event to it. Maybe I misunderstand something?