File tree Expand file tree Collapse file tree
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/h3 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,8 +158,13 @@ protected void initRequestStream(QuicStreamChannel ch) {
158158 header .set (PseudoHeaderName .SCHEME .value (), HttpConstants .HTTPS );
159159 header .set (Constants .TRI_PING , "0" );
160160
161- streamChannel .write (new DefaultHttp3HeadersFrame (header ));
162- streamChannel .shutdownOutput ();
161+ ChannelFuture pingSentFuture =
162+ streamChannel .write (new DefaultHttp3HeadersFrame (header ), streamChannel .newPromise ());
163+ if (pingSentFuture .isDone ()) {
164+ streamChannel .shutdownOutput ();
165+ } else {
166+ pingSentFuture .addListener ((ChannelFutureListener ) f -> streamChannel .shutdownOutput ());
167+ }
163168 } else {
164169 LOGGER .warn (TRANSPORT_FAILED_RECONNECT , "Failed to send ping frame" , future .cause ());
165170 }
You can’t perform that action at this time.
0 commit comments