Class OutboundByteBufAggregator
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelOutboundHandlerAdapter
-
- com.linkedin.alpini.netty4.handlers.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.
-
-
Field Summary
Fields Modifier and Type Field Description static int
SSL_PACKET_SIZE
-
Constructor Summary
Constructors Constructor Description OutboundByteBufAggregator()
OutboundByteBufAggregator(int packetSize)
OutboundByteBufAggregator(int packetSize, io.netty.buffer.ByteBufAllocator alloc)
-
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
-
-
-
-
Field Detail
-
SSL_PACKET_SIZE
public static final int SSL_PACKET_SIZE
- See Also:
- Constant Field Values
-
-
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 interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
write
in classio.netty.channel.ChannelOutboundHandlerAdapter
- Throws:
java.lang.Exception
-
flush
public void flush(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception
- Specified by:
flush
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
flush
in classio.netty.channel.ChannelOutboundHandlerAdapter
- Throws:
java.lang.Exception
-
-