quinn-rs / quinn

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

A way of explicitly detecting a timeout/connection close #1395

Closed WilliamVenner closed 2 years ago

WilliamVenner commented 2 years ago

Hi there,

Is there a way to explicitly detect if a connection has timed out or closed without affecting or opening streams?

I have a situation where I am waiting on a future that must be aborted if the connection times out or the connection closes. Unfortunately at this point I am unable to open, read or write to any streams of the connection, so I need to explicitly listen for a timeout/connection close.

Is there any way to do this in Quinn currently?

Many thanks

WilliamVenner commented 2 years ago

I found https://docs.rs/quinn/latest/quinn/struct.SendStream.html#method.stopped !!

Ralith commented 2 years ago

It's also common to use the end of incoming datagrams/streams/whatever from the streams in NewConnection to determine this.