类 NettyChannelHandler

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<io.netty.buffer.ByteBuf>
com.cdkjframework.socket.handler.NettyChannelHandler
所有已实现的接口:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

@Component @Sharable public class NettyChannelHandler extends io.netty.channel.SimpleChannelInboundHandler<io.netty.buffer.ByteBuf>
  • 嵌套类概要

    从接口继承的嵌套类/接口 io.netty.channel.ChannelHandler

    io.netty.channel.ChannelHandler.Sharable
  • 构造器概要

    构造器
    构造器
    说明
    构造函数
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    channelInactive(io.netty.channel.ChannelHandlerContext ctx)
    有客户端终止连接服务器会触发此函数
    void
    exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
    异常处理
    void
    handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
    连接成功
    void
    handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
    断开成功

    从类继承的方法 io.netty.channel.SimpleChannelInboundHandler

    acceptInboundMessage, channelRead

    从类继承的方法 io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered

    从类继承的方法 io.netty.channel.ChannelHandlerAdapter

    isSharable

    从类继承的方法 java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • NettyChannelHandler

      public NettyChannelHandler(SocketListener socketListener)
      构造函数
      参数:
      socketListener - 监听接口
  • 方法详细资料

    • handlerAdded

      public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) throws Exception
      连接成功
      指定者:
      handlerAdded 在接口中 io.netty.channel.ChannelHandler
      覆盖:
      handlerAdded 在类中 io.netty.channel.ChannelHandlerAdapter
      参数:
      ctx - 通道处理程序上下文
      抛出:
      Exception - 异常信息
    • handlerRemoved

      public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) throws Exception
      断开成功
      指定者:
      handlerRemoved 在接口中 io.netty.channel.ChannelHandler
      覆盖:
      handlerRemoved 在类中 io.netty.channel.ChannelHandlerAdapter
      参数:
      ctx - 通道处理程序上下文
      抛出:
      Exception - 异常信息
    • channelInactive

      public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
      有客户端终止连接服务器会触发此函数
      指定者:
      channelInactive 在接口中 io.netty.channel.ChannelInboundHandler
      覆盖:
      channelInactive 在类中 io.netty.channel.ChannelInboundHandlerAdapter
      参数:
      ctx - 通道进程
      抛出:
      Exception - 异常信息
    • exceptionCaught

      public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception
      异常处理
      指定者:
      exceptionCaught 在接口中 io.netty.channel.ChannelHandler
      指定者:
      exceptionCaught 在接口中 io.netty.channel.ChannelInboundHandler
      覆盖:
      exceptionCaught 在类中 io.netty.channel.ChannelInboundHandlerAdapter
      参数:
      ctx - 通道处理程序上下文
      cause - 异常信息
      抛出:
      Exception