| | |
| | | abstract var tag: String |
| | | |
| | | override fun channelRegistered(ctx: ChannelHandlerContext?) { |
| | | super.channelRegistered(ctx) |
| | | println("------【${tag}】IP连接:[ip:${ctx?.channel()?.remoteAddress()}] ${ |
| | | SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format( |
| | | Date() |
| | | )}") |
| | | // ctx?.fireChannelActive() |
| | | } |
| | | |
| | | override fun channelActive(ctx: ChannelHandlerContext?) { |
| | |
| | | SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format( |
| | | Date() |
| | | )}") |
| | | super.channelActive(ctx) |
| | | } |
| | | |
| | | override fun channelRead(ctx: ChannelHandlerContext?, msg: Any?) { |
| | | super.channelRead(ctx, msg) |
| | | println("------【${tag}】收到的原始数据:[ip:${ctx?.channel()?.remoteAddress()}] ${ |
| | | SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format( |
| | | Date() |
| | | )}") |
| | | } |
| | | |
| | | override fun channelReadComplete(ctx: ChannelHandlerContext?) { |
| | | super.channelReadComplete(ctx) |
| | | } |
| | | |
| | | override fun channelInactive(ctx: ChannelHandlerContext?) { |
| | |
| | | SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format( |
| | | Date() |
| | | )}") |
| | | super.channelInactive(ctx) |
| | | } |
| | | |
| | | @Deprecated("Deprecated in Java") |