fix : The client and server are connected synchronously

pull/1006/head
pizihao 3 years ago
parent 1910ddc8a6
commit 75176164c7

@ -108,7 +108,7 @@ public class NettyClientConnection implements ClientConnection {
}
@Override
public void close() {
public synchronized void close() {
if (this.channel == null) {
return;
}

@ -105,12 +105,13 @@ public class NettyServerConnection extends AbstractNettyHandlerManager implement
}
@Override
public void close() {
public synchronized void close() {
if (port == null) {
return;
}
leader.shutdownGracefully();
worker.shutdownGracefully();
this.leader.shutdownGracefully();
this.worker.shutdownGracefully();
this.channel.close();
this.future.channel().close();
log.info("The server is shut down and no more requests are received. The release port is {}", port.getPort());
}
@ -146,4 +147,5 @@ public class NettyServerConnection extends AbstractNettyHandlerManager implement
super.addFirst(handler);
return this;
}
}

Loading…
Cancel
Save