/* * Copyright (c) 2016. * chinaume@163.com */ package com.goav.netty.Handler; import io.netty.channel.ChannelHandlerAdapter; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelPromise; import io.netty.util.internal.logging.InternalLogger; import io.netty.util.internal.logging.InternalLoggerFactory; /** * Live$.<br/> * * @time: 16/10/8 11:25.<br/> * @author: Created by moo<br/> */ public class ChannelHandlerSuper extends ChannelHandlerAdapter { private static final InternalLogger logger = InternalLoggerFactory.getInstance(ChannelHandlerSuper.class); @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { super.channelRead(ctx, msg); } /** * 断网了 * * @param ctx * @throws Exception */ @Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { super.channelInactive(ctx); logger.info("socket 断开连接"); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { super.exceptionCaught(ctx, cause); logger.info("socket 异常"); } @Override public void close(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception { super.close(ctx, promise); logger.info("socket 关闭"); } }