GithubHelp home page GithubHelp logo

Comments (5)

 avatar commented on August 11, 2024

I dont understand purpose of MonitorTask...

Why is it reconnecting every 5 seconds? whats the purpose of that?

from websocket.

kryogenic avatar kryogenic commented on August 11, 2024

MonitorTask does 2 things:
a) Sends ping every 3 seconds (or as configured here https://github.com/OKCoin/websocket/blob/master/java/src/com/okcoin/websocket/WebSocketBase.java#L63)
b) Reconnects if "startTime" isn't updated within 5 seconds (startTime is updated each time something is read from the server)

I don't know why you're asking me, or why you're asking in this issue...

from websocket.

 avatar commented on August 11, 2024

Just saw you having issue on the same topic and tried to figure out... :)
I appreciate any answers you give.

I understand what it does, I just think its unnecessary piece of code, i mean will websocket connection close that soon? suppose we dont send or recieve something for 30 seconds (which is really hardly possible) is there a risk that it will close the connection?

do you think pinging every X seconds helps to something aside recovering from disconnection...?

from websocket.

kryogenic avatar kryogenic commented on August 11, 2024

The idea is that it reconnects if at any point the server takes more than 5 seconds to respond. Things like interruptions of internet connectivity on the client will cause the server to drop the client and stop sending messages, so the connection needs to be re-established.

from websocket.

 avatar commented on August 11, 2024

Thanks :) didn't know that

from websocket.

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.