Giter VIP home page Giter VIP logo

Comments (2)

s888 avatar s888 commented on July 29, 2024

Yes even I am facing this issue. The disconnect event on client side doesn't seem to work correctly. when the server dies or when the server sometimes discards the client sockets (don't know why). These disconnect events are not catched by the client. So there is really no way to know if the connection is still alive. Anybody who can help please?

from flashsocket.io.

gauravrane avatar gauravrane commented on July 29, 2024

@s888 @herzaso

Here's a quick hack.

Create a boolean in FlashSocket and check it at a greater interval than the heartbeat interval using a flash timer.

Set the boolean true every time you receive data from the server and set it to false at the timer interval.

Hence at the timer interval if the client has not received anything from the server then the boolean will be set to false at which point you can call the disconnect function and detect whether the client has disconnected.

Reconnection will also be possible in this case because the boolean will be set to true as soon as data is received from the server and the client will show as reconnected.

from flashsocket.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.