netty绑定端口报错bug解决
This commit is contained in:
parent
37539074a4
commit
cb45d95486
@ -53,6 +53,7 @@ public class NettyTcpServer {
|
|||||||
*/
|
*/
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void start() throws InterruptedException {
|
public void start() throws InterruptedException {
|
||||||
|
try {
|
||||||
ServerBootstrap serverBootstrap = new ServerBootstrap();
|
ServerBootstrap serverBootstrap = new ServerBootstrap();
|
||||||
serverBootstrap.group(bossGroup, workerGroup)
|
serverBootstrap.group(bossGroup, workerGroup)
|
||||||
.channel(NioServerSocketChannel.class)
|
.channel(NioServerSocketChannel.class)
|
||||||
@ -65,6 +66,9 @@ public class NettyTcpServer {
|
|||||||
if (channelFuture.isSuccess()) {
|
if (channelFuture.isSuccess()) {
|
||||||
log.info("定位TCP服务启动完毕,port={}", this.port);
|
log.info("定位TCP服务启动完毕,port={}", this.port);
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("定位TCP服务启动异常,port={}", this.port);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user