25,985
社区成员
发帖
与我相关
我的任务
分享
EventLoopGroup workerGroup = new NioEventLoopGroup();
Http2ClientInitializer initializer = new Http2ClientInitializer(sslCtx, Integer.MAX_VALUE);
Channel channel = null;
try
{
Bootstrap bootstrap = new Bootstrap();
bootstrap.group(workerGroup);
bootstrap.channel(NioSocketChannel.class);
bootstrap.option(ChannelOption.SO_KEEPALIVE, true);
bootstrap.remoteAddress(HOST, PORT);
bootstrap.handler(initializer);
channel = bootstrap.connect().syncUninterruptibly().channel();