You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by gu...@apache.org on 2022/04/22 07:24:33 UTC
[dubbo] branch 3.0 updated: Remove idle handler (#9952)
This is an automated email from the ASF dual-hosted git repository.
guohao pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.0 by this push:
new 3b7cb280e7 Remove idle handler (#9952)
3b7cb280e7 is described below
commit 3b7cb280e744d25c350e93831705e46d74ef445c
Author: GuoHao <gu...@gmail.com>
AuthorDate: Fri Apr 22 15:24:14 2022 +0800
Remove idle handler (#9952)
* Remove idle handler
* Fix format
---
.../org/apache/dubbo/remoting/api/PortUnificationServer.java | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/PortUnificationServer.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/PortUnificationServer.java
index f9b2bb4272..b28f428726 100644
--- a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/PortUnificationServer.java
+++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/PortUnificationServer.java
@@ -24,7 +24,6 @@ import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.ExecutorUtil;
import org.apache.dubbo.common.utils.NetUtils;
import org.apache.dubbo.remoting.Constants;
-import org.apache.dubbo.remoting.utils.UrlUtils;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.PooledByteBufAllocator;
@@ -36,7 +35,6 @@ import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.group.DefaultChannelGroup;
import io.netty.channel.socket.SocketChannel;
-import io.netty.handler.timeout.IdleStateHandler;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GlobalEventExecutor;
@@ -121,11 +119,8 @@ public class PortUnificationServer {
.childHandler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) throws Exception {
- // FIXME: should we use getTimeout()?
- int idleTimeout = UrlUtils.getIdleTimeout(getUrl());
+ // Do not add idle state handler here, because it should be added in the protocol handler.
final ChannelPipeline p = ch.pipeline();
-// p.addLast(new LoggingHandler(LogLevel.DEBUG));
-
final boolean enableSsl = getUrl().getParameter(SSL_ENABLED_KEY, false);
final PortUnificationServerHandler puHandler;
if (enableSsl) {
@@ -135,9 +130,6 @@ public class PortUnificationServer {
puHandler = new PortUnificationServerHandler(url, null, false, protocols,
channels);
}
-
- p.addLast("server-idle-handler",
- new IdleStateHandler(0, 0, idleTimeout, MILLISECONDS));
p.addLast("negotiation-protocol", puHandler);
}
});