This commit is contained in:
crusader 2018-04-24 02:13:27 +09:00
parent 414c2cdb2f
commit 57eda39031

View File

@ -68,7 +68,6 @@ public abstract class Server {
this.init(); this.init();
ChannelFuture cf = this.bind(serverBootstrap); ChannelFuture cf = this.bind(serverBootstrap);
cf.sync();
this.onStart(); this.onStart();
cf.channel().closeFuture().sync(); cf.channel().closeFuture().sync();
@ -84,7 +83,7 @@ public abstract class Server {
} }
protected ChannelFuture bind(ServerBootstrap serverBootstrap) throws Exception { protected ChannelFuture bind(ServerBootstrap serverBootstrap) throws Exception {
return serverBootstrap.bind(address); return serverBootstrap.bind(address).sync();
} }
protected abstract void init() throws Exception; protected abstract void init() throws Exception;