quinn
quinn copied to clipboard
Await connection drain
I am wondering if it mighty worth it to have a future to await the draining of the connection (if such possibility does not exist yet).
The scenario is the following:
async fn main() {
// ...
connection.close(VarInt::from_u32(0), b"bye");
}
The CLOSE frame might not be sent if program terminates before driver flushes egress.
On top of my head, I was thinking something like:
connection.close(...);
connection.drained().await; // Awaits flush egress
Feel free to close this issue in case, it is just a very minor concern :)