Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

217
Visualizações
Prevent mqtt.js to disconnect in browser

Short

Is there a way of preventing mqtt in the browser to disconnect when the browser loses focus?

The long one

Previously I used Paho mqtt from a browser talking to a secure web socket. Paho sometimes had trouble setting up the connection with Paho therefore we changed to mqtt.js

I find it much better at setting up the connection.

But, when I leave the browser for a while it seems to disconnect, however it connects really quick again when the tab gets the focus back.

I can see the reason for having a timeout function, but it should be possible to turn it off.

Is it?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This will be down to the browser suspending the tab when it's not visible to save resources (e.g. battery on mobile devices/laptops) and memory by swapping out the page.

In this case it is unlikely you will be able to influence this from within the page (as this would defeat the point)

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda