Commit 006da383 authored by zengtianlai3's avatar zengtianlai3

冗余的null检查

parent 3969ca4c
...@@ -33,16 +33,14 @@ public class OperateClient { ...@@ -33,16 +33,14 @@ public class OperateClient {
channelInitializer = new OperateChannelInitializer(handler); channelInitializer = new OperateChannelInitializer(handler);
EventLoopGroup eventLoopGroup = new NioEventLoopGroup(); EventLoopGroup eventLoopGroup = new NioEventLoopGroup();
bootstrap = new Bootstrap(); bootstrap = new Bootstrap();
if (bootstrap != null) { try {
try { bootstrap
bootstrap .channel(NioSocketChannel.class)
.channel(NioSocketChannel.class) .option(ChannelOption.SO_KEEPALIVE, true)
.option(ChannelOption.SO_KEEPALIVE, true) .group(eventLoopGroup)
.group(eventLoopGroup) .handler(channelInitializer);
.handler(channelInitializer); } catch (IllegalStateException ex) {
} catch (IllegalStateException ex) { log.error(ex.getMessage());
log.error(ex.getMessage());
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment