ACS自动重连提交
This commit is contained in:
@@ -11,7 +11,8 @@ public class OpcServerUtl {
|
|||||||
if (domain == null) {
|
if (domain == null) {
|
||||||
domain = "";
|
domain = "";
|
||||||
}
|
}
|
||||||
return OpcUtl.getServer(host, clsid, user, password, domain);
|
// return OpcUtl.getServer(host, clsid, user, password, domain);
|
||||||
|
return OpcUtl.getAutoServer(host, clsid, user, password, domain);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,6 +159,15 @@ public class OpcUtl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Server getAutoServer(String host, String clsid, String user, String password, String domain) throws WDKException {
|
||||||
|
checkTimeout();
|
||||||
|
Server server = null;
|
||||||
|
server = new Server(getConnection(host, clsid, user, password, domain), Executors.newSingleThreadScheduledExecutor());
|
||||||
|
AutoReconnectController autoReconnectController = new AutoReconnectController(server);
|
||||||
|
autoReconnectController.connect();
|
||||||
|
return server;
|
||||||
|
}
|
||||||
|
|
||||||
public static ConnectionInformation getConnection(String host, String clsid, String user, String password,
|
public static ConnectionInformation getConnection(String host, String clsid, String user, String password,
|
||||||
String domain) {
|
String domain) {
|
||||||
ConnectionInformation connection = new ConnectionInformation();
|
ConnectionInformation connection = new ConnectionInformation();
|
||||||
|
|||||||
Reference in New Issue
Block a user