Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
panxiaojun233 committed Jan 17, 2021
1 parent afca0af commit 79b73a7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ protected void doClose() throws Throwable {
}

channelGroup.close();
Thread.sleep(15000);
} catch (Throwable e) {
logger.warn(e.getMessage(), e);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.apache.dubbo.rpc.protocol.tri;

import org.apache.dubbo.remoting.api.Connection;
import org.apache.dubbo.remoting.exchange.Request;

import io.netty.channel.ChannelDuplexHandler;
Expand Down Expand Up @@ -28,6 +29,10 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
System.out.println("Http2 Setting");
}else if(msg instanceof Http2GoAwayFrame){
System.out.println("Http2 goAway!");
final Connection connection = Connection.getConnectionFromChannel(ctx.channel());
if (connection != null) {
connection.onIdle();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.apache.dubbo.rpc.protocol.tri;

import io.netty.handler.codec.http2.Http2GoAwayFrame;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;

Expand All @@ -16,6 +17,16 @@ public TripleHttp2ClientResponseHandler() {
super(false);
}

@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
super.userEventTriggered(ctx, evt);
if (evt instanceof Http2GoAwayFrame) {
System.out.println("TripleHttp2ClientResponseHandler goaway!!!");
//todo set stream refuse
ctx.close();
}
}

@Override
protected void channelRead0(ChannelHandlerContext ctx, Http2StreamFrame msg) throws Exception {
if (msg instanceof Http2HeadersFrame) {
Expand Down

0 comments on commit 79b73a7

Please sign in to comment.