My socket.io web socket application is not sending data to some users

23 views Asked by At

I've created a live quiz application using Node.js and socket.io over web sockets. Briefly, there's a specific time limit for each question, and I'm sending the countdown to the user with

 io.to(roomName).emit('countdown', countdown);
 io.to(roomName).emit('question', question);

along with 4-5 other similar parameters. The application scores the questions and ranks the top 10 participants. I've tested it at home with 4-5 devices without any issues, and also with a group of 10 friends, all fine. However, someone who wanted to use it for an event tried it with around 50-60 people, and apparently, half of the participants didn't receive the questions.

Do you think the issue could be server-related? I'm using Heroku, paying about $7 for basic plan a month. Would moving to a hosting solution that provides better internet speed solve this problem? Or could it be unrelated to the server side? I'm terminating the connection if no response is received within 5 seconds; could it have something to do with that?

const io = require('socket.io')(server, {
    cors: {
      origin: '*', // Tüm kaynaklardan gelen isteklere izin ver
      methods: ['GET', 'POST'], // İzin verilen HTTP metodları
    },
    pingInterval: 25000, 
    pingTimeout: 5000, 
  });

I set the ping delay time to 5 seconds, let me add this information too.

When I finished developing the product, my goal was to enable 400-500 people to participate in the live quiz simultaneously. However, I want to identify the source of the error that occurred during its use.

0

There are 0 answers