Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -11,7 +11,8 @@ public class OpcServerUtl {
|
||||
if (domain == null) {
|
||||
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 {
|
||||
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,
|
||||
String domain) {
|
||||
ConnectionInformation connection = new ConnectionInformation();
|
||||
|
||||
Reference in New Issue
Block a user