When to call nghttp3_conn_is_drained to know It's time to close #328
-
From https://nghttp2.org/nghttp3/programmers-guide.html#closing-http-3-connection-gracefully said, the server should call I try call nghttp3_conn_is_drained in Line 1074 in 0fd649a here my logic in stream_close callback, when receiver recv ShutdownReason, it will close connection finally if me.mode == ConnMode::Server && conn.nghttp3_conn_is_drained() && is_bidi_stream {
// Server want to shutdown, and all streams has been drained, send shutdown signal
// https://docs.rs/tokio/latest/tokio/sync/mpsc/struct.Sender.html#method.try_send
let _ = me.shutdown_conn.try_send(ShutdownReason {
code: AppErrorCode::NGHTTP3_H3_NO_ERROR,
reason: SmallVec::new(),
});
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In my http3 proxy server, I call nghttp3_conn_is_drained every time after writing packets. |
Beta Was this translation helpful? Give feedback.
In my http3 proxy server, I call nghttp3_conn_is_drained every time after writing packets.