类 PortUnificationHandshake

  • 所有已实现的接口:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

    public class PortUnificationHandshake
    extends io.netty.handler.codec.ByteToMessageDecoder
    统一端口服务处理器[协议握手] 注意:不能设置为Share

    使用同一个端口去处理TCP/HTTP协议的请求,因为HTTP的底层协议也是TCP,因此可以在此处理器内部可以通过解析部分数据 来判断请求是TCP请求还是HTTP请求,然使用动态的pipeline切换

    作者:
    Succy create on 2020/11/19
    • 嵌套类概要

      • 从类继承的嵌套类/接口 io.netty.handler.codec.ByteToMessageDecoder

        io.netty.handler.codec.ByteToMessageDecoder.Cumulator
      • 从接口继承的嵌套类/接口 io.netty.channel.ChannelHandler

        io.netty.channel.ChannelHandler.Sharable
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      protected io.netty.util.internal.logging.InternalLogger logger  
      • 从类继承的字段 io.netty.handler.codec.ByteToMessageDecoder

        COMPOSITE_CUMULATOR, MERGE_CUMULATOR
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      protected void decode​(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in, List<Object> out)  
      void exceptionCaught​(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)  
      • 从类继承的方法 io.netty.handler.codec.ByteToMessageDecoder

        actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
      • 从类继承的方法 io.netty.channel.ChannelInboundHandlerAdapter

        channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged
      • 从类继承的方法 io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, handlerAdded, isSharable
      • 从接口继承的方法 io.netty.channel.ChannelHandler

        handlerAdded
    • 字段详细资料

      • logger

        protected final io.netty.util.internal.logging.InternalLogger logger
    • 构造器详细资料

      • PortUnificationHandshake

        public PortUnificationHandshake()
    • 方法详细资料

      • decode

        protected void decode​(io.netty.channel.ChannelHandlerContext ctx,
                              io.netty.buffer.ByteBuf in,
                              List<Object> out)
        指定者:
        decode 在类中 io.netty.handler.codec.ByteToMessageDecoder
      • exceptionCaught

        public void exceptionCaught​(io.netty.channel.ChannelHandlerContext ctx,
                                    Throwable cause)
        指定者:
        exceptionCaught 在接口中 io.netty.channel.ChannelHandler
        指定者:
        exceptionCaught 在接口中 io.netty.channel.ChannelInboundHandler
        覆盖:
        exceptionCaught 在类中 io.netty.channel.ChannelInboundHandlerAdapter