From 429f9d85eddbb07081c149d7156964337ba688aa Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期三, 22 十一月 2023 15:28:40 +0800 Subject: [PATCH] 通信中间件开发,阶段性提交 --- pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandCache.java | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandCach.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandCache.java similarity index 72% rename from pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandCach.java rename to pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandCache.java index fcdf427..7a0cf8b 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandCach.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandCache.java @@ -10,18 +10,18 @@ /** * 闈炵嚎绋嬪畨鍏ㄧ殑锛屽彧鑳藉湪鍗曠嚎绋嬩腑杩愯 */ -public class TcpDownCommandCach { +public class TcpDownCommandCache { //TCP涓嬭鍛戒护缂撳瓨闃熷垪 - private static Queue cachQueue = new Queue("tcpDownComandQueue") ; + private static Queue cacheQueue = new Queue("tcpDownCommandQueue") ; - private static TcpDownCommandCach instance = new TcpDownCommandCach() ; + private static TcpDownCommandCache instance = new TcpDownCommandCache() ; - private TcpDownCommandCach(){ - cachQueue.setLimit(990000, 1000000); + private TcpDownCommandCache(){ + cacheQueue.setLimit(ServerProperties.cacheUpDownDataWarnCount, ServerProperties.cacheUpDownDataMaxCount); } - public static TcpDownCommandCach getInstance(){ + public static TcpDownCommandCache getInstance(){ return instance ; } @@ -30,16 +30,16 @@ * @param result * @throws Exception */ - public static void cachCommand(MidResultToRtu result) throws Exception{ + public static void cacheCommand(MidResultToRtu result) throws Exception{ if(result != null){ if(result.maxSendTimes == null){ //璁剧疆鏈�澶у彂閫佹鏁� result.maxSendTimes = ServerProperties.downComandMaxResendTimes ; } if(result.isSendFirst){ - cachQueue.pushHead(new TcpDownCommandObj(result)); + cacheQueue.pushHead(new TcpDownCommandObj(result)); }else{ - cachQueue.pushTail(new TcpDownCommandObj(result)); + cacheQueue.pushTail(new TcpDownCommandObj(result)); } } } @@ -52,7 +52,7 @@ public static MidResultToRtu matchFromHead(MidResultFromRtu rsFromRtu){ MidResultToRtu res = null ; TcpDownCommandObj obj = null ; - Node node = cachQueue.getFirstNode() ; + Node node = cacheQueue.getFirstNode() ; while(node != null && node.obj != null){ obj = (TcpDownCommandObj)node.obj; res = obj.result ; @@ -77,7 +77,7 @@ public static MidResultToRtu matchFromTail(MidResultFromRtu rsFromRtu){ MidResultToRtu res = null ; TcpDownCommandObj obj = null ; - Node node = cachQueue.getLastNode() ; + Node node = cacheQueue.getLastNode() ; while(node != null && node.obj != null){ obj = (TcpDownCommandObj)node.obj; res = obj.result ; @@ -99,7 +99,7 @@ * @return */ public static Node getFirstQueueNode(){ - return cachQueue.getFirstNode() ; + return cacheQueue.getFirstNode() ; } /** @@ -107,7 +107,7 @@ * @return */ public static Node getLastQueueNode(){ - return cachQueue.getLastNode() ; + return cacheQueue.getLastNode() ; } /** @@ -115,15 +115,15 @@ * @param node */ public static void removeNode(Node node){ - cachQueue.remove(node); + cacheQueue.remove(node); } /** * 缂撳瓨鐨勮妭鐐规暟 - * @param node + * @Return 缂撳瓨鑺傜偣鏁� */ public static Integer size(){ - return cachQueue.size() ; + return cacheQueue.size() ; } } -- Gitblit v1.8.0