|
2 | 2 |
|
3 | 3 | import com.codingapi.tm.Constants; |
4 | 4 | import com.codingapi.tm.config.ConfigReader; |
5 | | -import com.codingapi.tm.manager.service.TxManagerService; |
6 | 5 | import com.codingapi.tm.netty.handler.TxCoreServerHandler; |
7 | 6 | import com.codingapi.tm.netty.service.NettyServerService; |
8 | | - |
9 | 7 | import com.codingapi.tm.netty.service.NettyService; |
10 | 8 | import io.netty.bootstrap.ServerBootstrap; |
11 | 9 | import io.netty.channel.ChannelInitializer; |
|
15 | 13 | import io.netty.channel.socket.SocketChannel; |
16 | 14 | import io.netty.channel.socket.nio.NioServerSocketChannel; |
17 | 15 | import io.netty.handler.codec.LengthFieldBasedFrameDecoder; |
18 | | -import io.netty.handler.codec.LengthFieldPrepender; |
19 | 16 | import io.netty.handler.logging.LogLevel; |
20 | 17 | import io.netty.handler.logging.LoggingHandler; |
21 | 18 | import io.netty.handler.timeout.IdleStateHandler; |
@@ -66,8 +63,7 @@ public void start() { |
66 | 63 | public void initChannel(SocketChannel ch) throws Exception { |
67 | 64 | ch.pipeline().addLast("timeout", new IdleStateHandler(heartTime, heartTime, heartTime, TimeUnit.SECONDS)); |
68 | 65 |
|
69 | | - ch.pipeline().addLast(new LengthFieldPrepender(4, false)); |
70 | | - ch.pipeline().addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4, 0, 4)); |
| 66 | + ch.pipeline().addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 1, 1, 0, 0)); |
71 | 67 |
|
72 | 68 | ch.pipeline().addLast(txCoreServerHandler); |
73 | 69 | } |
|
0 commit comments