|
|
|
@ -3,6 +3,7 @@ package com.xydl.cac.iec;
|
|
|
|
|
import com.beanit.iec61850bean.*;
|
|
|
|
|
import com.xydl.cac.entity.IcdIed;
|
|
|
|
|
import com.xydl.cac.entity.constants.Constants;
|
|
|
|
|
import com.xydl.cac.model.StaticVariable;
|
|
|
|
|
import com.xydl.cac.socket.WebSocketServer;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
|
@ -82,6 +83,9 @@ public class IecClient implements ClientEventListener {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void reconnect() throws Exception {
|
|
|
|
|
if (StaticVariable.shutdown == 1) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
clientAssociation = clientSap.associate(InetAddress.getByName(ied.getIp()), ied.getPort(), null, this);
|
|
|
|
|
clientAssociation.setServerModel(serverModel);
|
|
|
|
|
log.info("61850订阅断线重连成功, ied=" + ied.getName() + ", ip=" + ied.getIp() + ", port=" + ied.getPort());
|
|
|
|
@ -165,7 +169,7 @@ public class IecClient implements ClientEventListener {
|
|
|
|
|
if (keep) {
|
|
|
|
|
this.disableReporting();
|
|
|
|
|
this.disconnect();
|
|
|
|
|
while (retry > 0) {
|
|
|
|
|
while (retry > 0 && StaticVariable.shutdown == 0) {
|
|
|
|
|
retry--;
|
|
|
|
|
try {
|
|
|
|
|
if (retry >= 5) {
|
|
|
|
|