Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
SocketIO get connection status / reconnect on mobile

Hi I've finally got my nodejs page to run but I noticed that mobile devices immediately drop the connection if the screen is turned off.

How can my client check if it's still connected and reconnect if not (once the screen is back on)? Or is there a way to prevent the disconnect in the first place?

Are there events i could use to go off of, or would i need to use an interval to check it?

Reconnecting immediately on disconnect probably wouldn't do any good because the screen is still off and the connection would just be closed again moments after, right?

just as a baseline here are the names of my server objects:

/* Server */
const socketio = require('socket.io');
const app = express();
const server = http.createServer(app);
const io = socketio(server);

io.on('connection', socket => {
    socket.on('joinRoom', ({ username, room }) => {
...

/* Client */
const socket = io();

socket.emit('joinRoom', { username, room });
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda