From fb1dc85a9ae6a9b8426ec5e29eb0139933ebe233 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期日, 29 九月 2019 11:22:24 +0800
Subject: [PATCH] 新增接口: 1. 获取某设备某时间段的数据流个数

---
 src/main/kotlin/com/flightfeather/obd/socket/ServerHandler.kt |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/obd/socket/ServerHandler.kt b/src/main/kotlin/com/flightfeather/obd/socket/ServerHandler.kt
index 475a87b..4c01a5b 100644
--- a/src/main/kotlin/com/flightfeather/obd/socket/ServerHandler.kt
+++ b/src/main/kotlin/com/flightfeather/obd/socket/ServerHandler.kt
@@ -14,10 +14,12 @@
 
     override fun channelRegistered(ctx: ChannelHandlerContext?) {
         super.channelRegistered(ctx)
+        println("------绔彛鏈塈P杩炴帴锛歔ip:${ctx?.channel()?.remoteAddress()}] ${SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date())}")
 //        ctx?.fireChannelActive()
     }
 
     override fun channelActive(ctx: ChannelHandlerContext?) {
+        println("------绔彛鏈塈P婵�娲伙細[ip:${ctx?.channel()?.remoteAddress()}] ${SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date())}")
         super.channelActive(ctx)
     }
 
@@ -40,7 +42,7 @@
                 } else {
                     a.toString(16)
                 }
-                print(s)
+                print("$s ")
                 sb.append(s).append(" ")
             }
             sb.deleteCharAt(sb.length - 1)
@@ -57,6 +59,7 @@
     }
 
     override fun channelInactive(ctx: ChannelHandlerContext?) {
+        println("------绔彛鏈塈P涓嶆椿鍔細[ip:${ctx?.channel()?.remoteAddress()}] ${SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date())}")
         super.channelInactive(ctx)
     }
 

--
Gitblit v1.9.3