Comments (5)
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.
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.
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.
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.
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)
- websocat does not report errors when the connection dies HOT 1
- Is there any way to print plain text of request and response when connecting to wss endpoint ? HOT 1
- Pkcs12 compatibility issues on OpenSSL 1.x.x HOT 5
- Consider allowing basic auth to be passed in environment variable to hide it from the rest of users HOT 4
- Saving Response from Websocat on windows OS HOT 1
- [v1.13.1] Release Date Request HOT 3
- Websocat client cannot connect even though wscat does? HOT 2
- pipe commands to websocat? HOT 3
- Cannot install in Fedora 40 container HOT 2
- websocat sometimes doesn't flush pending data, hangs HOT 6
- Feature request: Filter out whitespace from CLI HOT 4
- support overlay abstract-dgram-listen & unix-dgram-listen HOT 1
- Process does not terminate HOT 3
- How can I pass an argument with websocat without using echo? HOT 2
- Feature request: handle Unix Domain Socket (UDS) HOT 1
- Need help on compile HOT 2
- AUR Package Missing?
- `WebSocketError: I/O failure` when connecting with incorrect URI.
- `invalid socket address syntax` when using alternative transport for `ws-listen` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from websocat.