Commit a01bd0c0 authored by Administrator's avatar Administrator

udpate

parent a75f3e07
...@@ -79,7 +79,11 @@ public class G4ProxyClient { ...@@ -79,7 +79,11 @@ public class G4ProxyClient {
private volatile boolean isConnecting = false; private volatile boolean isConnecting = false;
void forceReconnect() { void forceReconnect() {
Channel channelCopy = natChannel;
natChannel = null; natChannel = null;
if (channelCopy.isActive()) {
channelCopy.close();
}
connectNatServer(); connectNatServer();
} }
......
...@@ -195,7 +195,8 @@ public class NatServerChannelHandler extends SimpleChannelInboundHandler<NatMess ...@@ -195,7 +195,8 @@ public class NatServerChannelHandler extends SimpleChannelInboundHandler<NatMess
NatClientImage client = clientManager.getClient(clientId); NatClientImage client = clientManager.getClient(clientId);
Channel natChannel1 = client.getNatChannel(); Channel natChannel1 = client.getNatChannel();
if (natChannel == natChannel1) { if (natChannel == natChannel1) {
log.info("the nat channel InActive ,close "); //nat channel 断开,需要关闭mapping port
log.info("the nat channel InActive ,close mapping port ");
client.getUserMappingServerChannel().close(); client.getUserMappingServerChannel().close();
} }
......
...@@ -40,6 +40,7 @@ public class ClientManager { ...@@ -40,6 +40,7 @@ public class ClientManager {
Channel userMappingServerChannel = userMappingServerChannels.get(mappingPort); Channel userMappingServerChannel = userMappingServerChannels.get(mappingPort);
if (userMappingServerChannel == null || !userMappingServerChannel.isActive()) { if (userMappingServerChannel == null || !userMappingServerChannel.isActive()) {
log.info("re open mapping port: {}", mappingPort);
ChannelFuture channelFuture = userMappingBootstrap.bind(mappingPort); ChannelFuture channelFuture = userMappingBootstrap.bind(mappingPort);
try { try {
channelFuture.get(); channelFuture.get();
......
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