package com.anyun.exam.lib.net
|
|
import android.util.Log
|
import io.netty.channel.ChannelPromise
|
import io.netty.channel.ChannelDuplexHandler
|
import io.netty.channel.ChannelFutureListener
|
import io.netty.channel.ChannelHandlerContext
|
|
|
class ExceptionHandler : ChannelDuplexHandler() {
|
override fun exceptionCaught(ctx: ChannelHandlerContext, cause: Throwable) {
|
// Uncaught exceptions from inbound handlers will propagate up to this handler
|
Log.e(Constant.LOGTAG,cause.localizedMessage)
|
}
|
// @Throws(Exception::class)
|
// override fun write(ctx: ChannelHandlerContext, msg: Any, promise: ChannelPromise) {
|
// ctx.write(msg, promise.addListener { future ->
|
// if (!future.isSuccess) {
|
// logger.error("send data to client exception occur: ", future.cause())
|
// }
|
// })
|
// }
|
|
}
|