ZhangWenTao 2 éve
szülő
commit
1709eadfa1

+ 8 - 1
src/main/java/com/persagy/cameractl/cache/IPCWithNVRCache.java

@@ -56,6 +56,13 @@ public class IPCWithNVRCache {
             try {
                 // 读取IPC信息, 构建缓存
                 for (ReqSetServerUriInfo reqSetServerUriInfo : loadNvrIpcInfo(loginHandler, nvrItem)) {
+                    if (cache.containsKey(reqSetServerUriInfo.getIp())) {
+                        log.warn("ipc ip repeat: ip-{} , nvr1-{} nvr2-{}",
+                                reqSetServerUriInfo.getIp(),
+                                cache.get(reqSetServerUriInfo.getIp()).getNvr().getIp(),
+                                nvrItem.getIp());
+                    }
+
                     cache.put(reqSetServerUriInfo.getIp(), new IPCInfo(reqSetServerUriInfo, nvrItem));
                 }
 
@@ -73,7 +80,7 @@ public class IPCWithNVRCache {
 
     private List<ReqSetServerUriInfo> loadNvrIpcInfo(WinDef.DWORD loginHandler,
                                                      NVRConfigurationProperties.NVRItem nvrItem) throws Exception {
-        int pIPCServerListSize = 4 * 1024 * 1024;
+        int pIPCServerListSize = 2 * 1024 * 1024;
         byte[] pIPCServerList = new byte[pIPCServerListSize];
         WinDef.UINTByReference nRealSizeRef = new WinDef.UINTByReference(
                 new WinDef.UINT(pIPCServerListSize));