src/main/kotlin/com/flightfeather/obd/socket/ServerHandler.kt
@@ -14,10 +14,12 @@
    override fun channelRegistered(ctx: ChannelHandlerContext?) {
        super.channelRegistered(ctx)
        println("------端口有IP连接:[ip:${ctx?.channel()?.remoteAddress()}] ${SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date())}")
//        ctx?.fireChannelActive()
    }
    override fun channelActive(ctx: ChannelHandlerContext?) {
        println("------端口有IP激活:[ip:${ctx?.channel()?.remoteAddress()}] ${SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date())}")
        super.channelActive(ctx)
    }
@@ -35,8 +37,13 @@
                } else {
                    it.toInt()
                }
                print("${a.toString(16)} ")
                sb.append(a.toString(16)).append(" ")
                val s = if (a < 16) {
                    "0${a.toString(16)}"
                } else {
                    a.toString(16)
                }
                print("$s ")
                sb.append(s).append(" ")
            }
            sb.deleteCharAt(sb.length - 1)
        }
@@ -52,6 +59,7 @@
    }
    override fun channelInactive(ctx: ChannelHandlerContext?) {
        println("------端口有IP不活动:[ip:${ctx?.channel()?.remoteAddress()}] ${SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date())}")
        super.channelInactive(ctx)
    }