| | |
| | | import io.netty.channel.ChannelHandlerContext |
| | | import io.netty.channel.ChannelInboundHandlerAdapter |
| | | import io.netty.util.AttributeKey |
| | | import org.ietf.jgss.MessageProp |
| | | import java.lang.StringBuilder |
| | | import java.text.SimpleDateFormat |
| | | import java.util.* |
| | |
| | | |
| | | println(str) |
| | | |
| | | if (str == "01 04 00 00 00 00 00 00 00 00 00") { |
| | | ctx?.writeAndFlush("trigger") |
| | | return |
| | | } |
| | | if (str.isNotEmpty()) { |
| | | ctx?.writeAndFlush("data") |
| | | processor.dealStringMsg(str, ctx) |
| | | } |
| | | } |
| | |
| | | super.channelInactive(ctx) |
| | | } |
| | | |
| | | @Deprecated("Deprecated in Java") |
| | | override fun exceptionCaught(ctx: ChannelHandlerContext?, cause: Throwable?) { |
| | | cause?.printStackTrace() |
| | | ctx?.close() |