Closed qixiaobo closed 4 years ago
Bootstrap bootstrap = new Bootstrap(); bootstrap.group(group) .channel(NioSocketChannel.class) .handler(new ChannelInitializer<SocketChannel>() { @Override public void initChannel(SocketChannel channel) throws Exception { channel.pipeline() .addLast(new IdleStateHandler(0,0,10, TimeUnit.MINUTES)) .addLast(new HttpClientCodec()) .addLast(new HttpObjectAggregator(5*1024*1024)) .addLast(new NettyHttpClientHandler(xxlRpcInvokerFactory, serializer)); } }) .option(ChannelOption.SO_KEEPALIVE, true);
Only keepalive used here. We also need connection timeout and so on
你好,如果紧急超时时间可自行定制,这部分将会排期讨论确认。
Only keepalive used here. We also need connection timeout and so on