vi / websocat

Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
MIT License
6.72k stars 257 forks source link

"dropped a ping request from websocket due to channel contention" #222

Closed WxNzEMof closed 2 months ago

WxNzEMof commented 2 months ago

Testing transferring large amounts of data via websocat, I hit this error.

[WARN  websocat::ws_peer] dropped a ping request from websocket due to channel contention
websocat: WebSocketError: I/O failure
websocat: error running

I think it is a RFC violation. https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.2 says:

Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in response, unless it already received a Close frame.

vi commented 2 months ago

Implemented (somewhat sloppy) caching of pongs, so that there is another change to deliver them.

The scheme is not foolproof, but I expect probability of missed pongs to be much lower with change.

Please check how it behaves on master.

WxNzEMof commented 2 months ago

Thanks! It doesn't happen any more with my test.