@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, writebind, close, connect, deregister, disconnect, flush, readensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedpublic 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.