| | |
| | | |
| | | 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) |
| | | } |
| | | |
| | |
| | | } 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) |
| | | } |
| | |
| | | } |
| | | |
| | | override fun channelInactive(ctx: ChannelHandlerContext?) { |
| | | println("------端口有IP不活动:[ip:${ctx?.channel()?.remoteAddress()}] ${SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date())}") |
| | | super.channelInactive(ctx) |
| | | } |
| | | |