First post, I will try to be as clear as possible :)
I am trying to create a Demand namespace in my application SocketIO / NodeJS.
Basically, the server creates a specific namespace for each client.
I need to handle the server side, a case where a client is trying to access a nonexistent namespace.
The idea is to avoid an unwanted server-side connection, or at least deal with it to disconnect.
But when testing, it seems that when I try to do this, on the client side:
var socket = io("thisNameSpaceDontExist"); socket.on('connect', function(){ window.console.log('connected to server'); })
The "connect" event will not fire, which seems perfect! By executing console.log on socket , it displays this:
connected: false disconnected: true
But the main problem is that on the server side it is different, there is an active connection ... During some research, I found this problem https://github.com/Automattic/socket.io/issues/1867 , but I'm on the last current version: 1.3.5
for information, the socketIOHandler code that I use: io.on ('connection', function (socket) {console.log ("[SocketIOHandler :: Connection] +1");
socket.on('disconnect', function () { console.log("[SocketIOHandler::Disconnection] -1"); }); });
PS: Also find some problems and MRs that require support for dynamic namespaces: https://github.com/Automattic/socket.io/issues/1854 , but they are not combined, so I really do not understand the behavior of my code ...
Thanks!