I have a really strange issue going on here in a socket.io development.
Everything is working just fine (emits to/from server) except that from a 3G connection the server does the following:
console.log( io.sockets.adapter.rooms['thisroom'] )
This line, almost every time, returns a typeof of 'undefined', as if there where not sockets connected in the given 'thisroom' room when there actually are sockets connected to the room.
If the same code is executed from a WIFI connection, under the same circumstances, with the same sockets connected, the above line returns something like:
Room { sockets: { '/#wEkHFuAhbCEf1Dw2AAAC': true }, length: 1 }
which is correct.
I've tried everything with this as to:
Tried socket.io version 1.3.7
Tried socket.io version 1.4.8
Tried to connect with
var socket = io.connect("http://<ip>:8081");
Tried to force to websockets transport only with:
var socket = io.connect("http://<ip>:8081", {transports: ['websocket']});
Tried to use two transports as:
var socket = io.connect("http://<ip>:8081", {transports: ['websocket', 'polling']});
Nothing worked.
It is really weird because sometimes, the 3G connection works as expected when just restarting the app. But most of the time, it does work.
Ideas?