quinn-rs / quinn

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

Suggestion: getter for max_idle_timeout #1368

Closed Banyc closed 2 years ago

Banyc commented 2 years ago

So that I can set keep_alive_interval accordingly.

Alternatives

Or allow setting keep_alive_interval after the actual idle timeout is negotiated.

Ralith commented 2 years ago

Keep-alive interval (and the peer responsible for sending keep-alives) should be generally specified as part of your application-layer protocol, so that peers aren't exposed to a risk of setting an idle timeout too low to begin with.

Banyc commented 2 years ago

@Ralith Should both max_idle_timeout and keep_alive_interval be explicitly set in the application layer? Just to confirm my understanding.

Thanks!

Ralith commented 2 years ago

That's usually a good idea, yeah. A getter on its own wouldn't be sufficient anyway, since connection configuration must generally be established before the connection is made. That could be mitigated by adding setters as needed as well, but that's a bunch of extra plumbing and API for a case that's simpler to address purely with good application layer design.

Banyc commented 2 years ago

Huge thanks!