@UnstableApi @ChannelHandler.Sharable public class DatagramDnsResponseEncoder extends MessageToMessageEncoder<AddressedEnvelope<DnsResponse,java.net.InetSocketAddress>>
ChannelHandler.Sharable
Constructor and Description |
---|
DatagramDnsResponseEncoder()
用
the default record encoder创建一个新的编码器。
|
DatagramDnsResponseEncoder(DnsRecordEncoder recordEncoder)
用指定的
recordEncoder 创建一个新的编码器。
|
Modifier and Type | Method and Description |
---|---|
protected ByteBuf |
allocateBuffer(ChannelHandlerContext ctx, AddressedEnvelope<DnsResponse,java.net.InetSocketAddress> msg)
分配将用于构造数据报包的 ByteBuf 。
|
protected void |
encode(ChannelHandlerContext ctx, AddressedEnvelope<DnsResponse,java.net.InetSocketAddress> in, java.util.List<java.lang.Object> out)
从一条消息编码到另一条消息。
|
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,java.net.InetSocketAddress> in, java.util.List<java.lang.Object> out) throws java.lang.Exception
MessageToMessageEncoder
encode
在课程
MessageToMessageEncoder<AddressedEnvelope<DnsResponse,java.net.InetSocketAddress>>
ctx
- 这MessageToMessageEncoder
所属的ChannelHandlerContext
in
- 要编码到另一个的消息
out
- 应该添加编码味精的
List
需要做某种聚合
java.lang.Exception
- 发生错误时抛出
protected ByteBuf allocateBuffer(ChannelHandlerContext ctx, AddressedEnvelope<DnsResponse,java.net.InetSocketAddress> msg) throws java.lang.Exception
java.lang.Exception
Copyright © 2008–2018 The Netty Project. All rights reserved.