Giter Club home page Giter Club logo

Comments (5)

vi avatar vi commented on September 10, 2024

Currently (in Websocat1) the algorithm is simple: the deadline timer is wind up at now + ping_timeout, each time Pong arrives (whether requested or not), it resets to now _ ping_timeout.

Ping sender and pong receiver components do not know about each other.

There is also a fix for pong replier (b93a7f6), pending for Websocat v1.14.0. With the fix, it prioritizes replying to a ping over relaying more traffic, but it does not currently prioritize sending a ping over relaying more traffic. Maybe I'll fix it.

Websocat4 (redesigned version) does not currently send pings, though replies to incoming pings are already prioritized.

from websocat.

vi avatar vi commented on September 10, 2024

Added outgoing ping prioritisation (commit 214de61), but it doesn't seem to help much when socket send buffer is full.

I'm not sure how to properly implement priority ping/pongs without sacrificing bandwidth over high-RTT channel or using platform-specific socket options like SIOCOUTQ.

I'll think about it when I'll be implementing pings in Websocat4 - it's unlikely I'll make serious changes to Websocat1.

from websocat.

lovemyliwu avatar lovemyliwu commented on September 10, 2024

Thanks for your fast response, I recommand to use simple strategy that aligns with intuition in Websocat 4.

If the channel is busy, just drop the ping request, but the pong receiver should know the situation and ignore timeout check.

from websocat.

vi avatar vi commented on September 10, 2024

There will probably be the following additional options:

  • --ping-each-bytes n - send ping each N outgoing bytes
  • --interpret-any-incoming-data-as-pong - reset watchdog timer also on any incoming data
  • --interpret-any-outoing-data-as-pong - reset watchdog times also on any outgoing data

Ability to send more outgoing data to a congested channel indicated that the channel is still alive.
Also interleaving data with ping requests should cause a consistent stream of pong replies if the data is really flowing, not stuck.


Do you think a watchdog should (by default) not only check presense of Pong replies, but also correctness of Pong replies?

from websocat.

lovemyliwu avatar lovemyliwu commented on September 10, 2024

For me, check presense is enough. 😃


I implemented ignore timeout check logic based on Websocat 1, If somebody interst, please check b93a7f6...11959c1

from websocat.

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.