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

359
Vistas
Expo React Native socket.io listeners "went lost"

I am developing a chat app with socket.IO (frontend: React Native, backend: NodeJS). Everything works fine but sometimes messages are not sent and I discovered the problem is due to socket listeners, which sometimes went lost without an apparent reason. Infact, when mounting the component, i call useEffect to subscribe listeners like this:

useEffect(() => {
        socket.on("receiveMessage", callback);
        socket.on("receiveAck, callback);
        ... and others
},[])

if i console.log(socket._callbacks), the result is an array with the names of listeners and their relative callbacks

for example: console.log(socket._callbacks) => [ ["receiveMessage", callback function], ["receiveAck", callback function], ...]

when messages begin to not work properly, i console.log(socket._callbacks) and the result is an EMPTY ARRAY, so it's like all the listeners went lost. And the strange thing is that it happens even when the socket is correctly connected to the server (console.log(socket.connected) => true).

why this happens?

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