quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Connection loss notification #1398

Closed MOZGIII closed 2 years ago

MOZGIII commented 2 years ago

I'm looking for a way to detect when a connection was lost, but I can't find anything I could use.

It seems like there is some machinery available internally for that, but I don't see it exposed.

My use case is proxying the incoming connections to the dynamically coming and going upstream, and I need to know when an upstream is gone. The upstreams count can be huge (say 10000 per server), and the proxy is a dynamic amount of long-running bidi data flows (low-intensive though).

Ralith commented 2 years ago

See https://github.com/quinn-rs/quinn/pull/1396.

MOZGIII commented 2 years ago

Cool, thx! While we're at it: any chance of getting this released to crates.io in the near future?

Ralith commented 2 years ago

I don't have specific plans for a release soon. Is there a problem with using the existing approach described in that PR?

MOZGIII commented 2 years ago

No, all good. It's just that PR is pretty important (at least it seems to be) but without the release changes from it are not discoverable via docs.rs. The changes themselves can be used if pulled via git of course, but that still is a bit of a problem for discovery. On the topic of the issue: solved, just what I was looking for.

Ralith commented 2 years ago

To be clear, the text of the PR describes how to accomplish this using the existing, released, API.

MOZGIII commented 2 years ago

Yep, that works too!