@ChannelHandler.Sharable public class DatagramDnsResponseEncoder extends MessageToMessageEncoder<AddressedEnvelope<DnsResponse,InetSocketAddress>>
ChannelHandler.Sharable
Constructor and Description |
---|
DatagramDnsResponseEncoder()
Creates a new encoder with the default record encoder.
|
DatagramDnsResponseEncoder(DnsRecordEncoder recordEncoder)
Creates a new encoder with the specified
recordEncoder . |
Modifier and Type | Method and Description |
---|---|
protected ByteBuf |
allocateBuffer(ChannelHandlerContext ctx,
AddressedEnvelope<DnsResponse,InetSocketAddress> msg)
Allocate a
ByteBuf which will be used for constructing a datagram packet. |
protected void |
encode(ChannelHandlerContext ctx,
AddressedEnvelope<DnsResponse,InetSocketAddress> in,
List<Object> out)
Encode from one message to an other.
|
acceptOutboundMessage, write
bind, close, connect, deregister, disconnect, flush, read
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionCaught, handlerAdded, handlerRemoved
public DatagramDnsResponseEncoder()
public DatagramDnsResponseEncoder(DnsRecordEncoder recordEncoder)
recordEncoder
.protected void encode(ChannelHandlerContext ctx, AddressedEnvelope<DnsResponse,InetSocketAddress> in, List<Object> out) throws Exception
MessageToMessageEncoder
encode
in class MessageToMessageEncoder<AddressedEnvelope<DnsResponse,InetSocketAddress>>
ctx
- the ChannelHandlerContext
which this MessageToMessageEncoder
belongs toin
- the message to encode to an other oneout
- the List
into which the encoded msg should be added
needs to do some kind of aggregationException
- is thrown if an error occursprotected ByteBuf allocateBuffer(ChannelHandlerContext ctx, AddressedEnvelope<DnsResponse,InetSocketAddress> msg) throws Exception
ByteBuf
which will be used for constructing a datagram packet.
Sub-classes may override this method to return a ByteBuf
with a perfect matching initial capacity.Exception
Copyright © 2008–2024 The Netty Project. All rights reserved.