瀏覽代碼

IPC缓存修改

ZhangWenTao 2 年之前
父節點
當前提交
1709eadfa1
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      src/main/java/com/persagy/cameractl/cache/IPCWithNVRCache.java

+ 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));