Clients don't receive messages
See original GitHub issueI have server and clients in node.js.
Every time client connects to server:
var response = {};
if (currentPlayers < maxPlayers) {
currentPlayers++;
response.username = currentPlayers;
players[currentPlayers] = {
score: 0
};
socket.join('players');
} else {
if (currentPlayers === maxPlayers) {
//Set a little delay
setTimeout(function () {
//I also tried this:
//players_sockets.forEach(function (s) {
// s.emit('start');
//});
io.to('players').emit('start');
}, 1500);
}
}
Server checks is there enough players for game, if it is, server emits start
message. The problem is that some clients doesn’t receive this message(to be current: mobile devices(e.g. meizu mx5, iphone 5, iphone 5s and some others).
I watched debug: they are using long-polling.
Desktop clients, which are connected with WebSocket are okay.
How i need to fix this? Or maybe I’m doing something wrong?
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (1 by maintainers)
Top Results From Across the Web
Clients aren't receiving email or SMS notifications
Problem. A client didn't receive an email or SMS message that should have been sent by an automated marketing campaign or as an...
Read more >Why is my client not receiving SMS text messages?
If your clients are not receiving SMS notifications, there might be an issue with their contact information or subscription preferences.
Read more >What Should You Do When a Client Ignores You?
Here's what to do if you can't get a hold of your client. Is your client dodging your emails and calls? It might...
Read more >5 Reasons Your SMS Messages Don't Reach ...
Customer complaints lead to blocked numbers · Explicitly note how to opt out · Clearly identify the sender · Mention why customers are...
Read more >10 Reasons Why Some Messages Don't Get Delivered
10 Reasons Why Some Messages Don't Get Delivered · 1) The recipient's phone is switched off · 2) False negative · 3) The...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Socket.io doesn’t replace long polling. And by design it can fallback to XHR long polling if web sockets are unavailable or socket.io isn’t too warm and fuzzy about the web socket implementation. For whatever reason some browsers/clients make it switch to the fallback. I worked on an application where I only wanted web sockets. So I enforced it via the connection configuration using `“transports” : [“websocket”]`` and used Modenizr to ensure web sockets were available. This did the trick for me and the browsers quit performing a fallback to XHR long polling.
Closed due to inactivity, please reopen if needed.