springboot-netty icon indicating copy to clipboard operation
springboot-netty copied to clipboard

这个报错怎么处理啊??

Open zhangpengfei1028 opened this issue 4 years ago • 1 comments

image public class ClientHandlerInitializer extends ChannelInitializer<Channel> {

@Override
protected void initChannel(Channel ch) throws Exception {
    ch.pipeline()
            .addLast(new IdleStateHandler(0, 10, 0))
            .addLast(new ProtobufVarint32FrameDecoder())
            .addLast(new ProtobufDecoder(MessageBase.Message.getDefaultInstance()))
            .addLast(new ProtobufVarint32LengthFieldPrepender())
            .addLast(new ProtobufEncoder())
            .addLast(new HeartbeatHandler())
            .addLast(new NettyClientHandler());
}

}

zhangpengfei1028 avatar Dec 28 '20 03:12 zhangpengfei1028

addLast(new HeartbeatHandler(new NettyClient())),创建一个客户端进行连接就行,你可以尝试下

dulante00 avatar May 24 '21 07:05 dulante00