Class OutboundByteBufAggregator

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelOutboundHandler

    public final class OutboundByteBufAggregator
    extends io.netty.channel.ChannelOutboundHandlerAdapter
    SSL uses 16kb application message packets. This handler aims to combine the ByteBuf into packet-sized chunks, This is due to limitations in the SSL implementation which prefers contiguous messages to process so we must break down composite ByteBuf objects. This Aggregator includes a constructor which accepts a allocator to avoid memory fragmentation. Since we always use 16KB buffers.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

        io.netty.channel.ChannelHandler.Sharable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int SSL_PACKET_SIZE  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void flush​(io.netty.channel.ChannelHandlerContext ctx)  
      void write​(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg, io.netty.channel.ChannelPromise promise)  
      • Methods inherited from class io.netty.channel.ChannelOutboundHandlerAdapter

        bind, close, connect, deregister, disconnect, read
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.netty.channel.ChannelHandler

        exceptionCaught, handlerAdded, handlerRemoved
    • Constructor Detail

      • OutboundByteBufAggregator

        public OutboundByteBufAggregator()
      • OutboundByteBufAggregator

        public OutboundByteBufAggregator​(int packetSize)
      • OutboundByteBufAggregator

        public OutboundByteBufAggregator​(int packetSize,
                                         io.netty.buffer.ByteBufAllocator alloc)
    • Method Detail

      • write

        public void write​(io.netty.channel.ChannelHandlerContext ctx,
                          java.lang.Object msg,
                          io.netty.channel.ChannelPromise promise)
                   throws java.lang.Exception
        Specified by:
        write in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        write in class io.netty.channel.ChannelOutboundHandlerAdapter
        Throws:
        java.lang.Exception
      • flush

        public void flush​(io.netty.channel.ChannelHandlerContext ctx)
                   throws java.lang.Exception
        Specified by:
        flush in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        flush in class io.netty.channel.ChannelOutboundHandlerAdapter
        Throws:
        java.lang.Exception