From 7efbf921192559cad13a4f8086c46c3617ad2a05 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 31 十月 2024 08:34:42 +0800
Subject: [PATCH] 1、协议解析中,关阀报(83)中的RTU时钟改为关阀时间,但代码误注解掉了这行代码,修改之; 2、通信中间件测试web系统增加查询所在在线情况的命令下发。
---
pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpHandler.java | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpHandler.java b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpHandler.java
index 01c4a53..c8882d0 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpHandler.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpHandler.java
@@ -1,5 +1,6 @@
package com.dy.pipIrrMwTestRtu.tcpClient;
+import com.dy.common.util.ByteUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.mina.core.service.IoHandlerAdapter;
@@ -16,6 +17,7 @@
*/
@Override
public void sessionCreated(IoSession session) throws Exception {
+ super.sessionCreated(session);
}
/**
@@ -23,6 +25,7 @@
*/
@Override
public void sessionOpened(IoSession session) throws Exception {
+ super.sessionOpened(session);
}
/**
@@ -30,6 +33,7 @@
*/
@Override
public void sessionClosed(IoSession session) throws Exception {
+ super.sessionClosed(session);
}
/**
@@ -37,6 +41,7 @@
*/
@Override
public void sessionIdle(IoSession session, IdleStatus status) throws Exception {
+ super.sessionIdle(session, status);
}
/**
@@ -51,6 +56,10 @@
*/
@Override
public void messageReceived(IoSession session, Object message) throws Exception {
+ if(message != null){
+ byte[] bs = (byte[])message ;
+ log.info("鏀跺埌涓棿浠舵暟鎹細" + ByteUtil.bytes2Hex(bs, true));
+ }
}
/**
@@ -58,6 +67,12 @@
*/
@Override
public void messageSent(IoSession session, Object message) throws Exception {
+ log.info("缃戠粶鍙戦�佷簡鏁版嵁锛�"
+ + (session==null?"":(session.getRemoteAddress() != null?("涓棿浠剁綉鍧�鏄細" + session.getRemoteAddress().toString()):"")) );
+ if(message != null){
+ byte[] bs = (byte[])message ;
+ log.info("缃戠粶鍙戦�佷簡鏁版嵁锛�" + ByteUtil.bytes2Hex(bs, true));
+ }
}
/**
--
Gitblit v1.8.0