Top Description Fields Constructors Methods
io.netty5.handler.codec.dns

public Class DatagramDnsResponseDecoder

extends MessageToMessageDecoder<DatagramPacket>
Class Inheritance
Annotations
@UnstableApi
Imports
io.netty5.channel.ChannelHandlerContext, io.netty5.channel.socket.DatagramPacket, io.netty5.handler.codec.CorruptedFrameException, .MessageToMessageDecoder, io.netty5.util.internal.UnstableApi, java.net.InetSocketAddress

Decodes a DatagramPacket into a DatagramDnsResponse.

Field Summary

Modifier and TypeField and Description
private final DnsResponseDecoder<InetSocketAddress>

Constructor Summary

AccessConstructor and Description
public
public
DatagramDnsResponseDecoder(DnsRecordDecoder recordDecoder)

Creates a new decoder with the specified recordDecoder.

Method Summary

Modifier and TypeMethod and Description
protected void
decode(ChannelHandlerContext ctx, DatagramPacket
the message to decode to another one
packet
)

Overrides io.netty5.handler.codec.MessageToMessageDecoder.decode.

Decode from one message to another.
protected DnsResponse
public boolean
isSharable()

Overrides default io.netty5.channel.ChannelHandler.isSharable.

Returns true if this handler is sharable and thus can be added to more than one ChannelPipeline.
Inherited from io.netty5.handler.codec.MessageToMessageDecoder:
acceptInboundMessagechannelReaddecodeAndClose

Field Detail

responseDecoderback to summary
private final DnsResponseDecoder<InetSocketAddress> responseDecoder

Constructor Detail

DatagramDnsResponseDecoderback to summary
public DatagramDnsResponseDecoder()

Creates a new decoder with the default record decoder.

DatagramDnsResponseDecoderback to summary
public DatagramDnsResponseDecoder(DnsRecordDecoder recordDecoder)

Creates a new decoder with the specified recordDecoder.

Method Detail

decodeback to summary
protected void decode(ChannelHandlerContext ctx, DatagramPacket packet) throws Exception

Overrides io.netty5.handler.codec.MessageToMessageDecoder.decode.

Doc from io.netty5.handler.codec.MessageToMessageDecoder.decode.

Decode from one message to another. This method will be called for each written message that can be handled by this decoder.

The message will be disposed of after this call.

Subclasses that wish to sometimes pass messages through, should instead override the decodeAndClose(ChannelHandlerContext, Object) method.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this MessageToMessageDecoder belongs to

packet:DatagramPacket

the message to decode to another one

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurs
decodeResponseback to summary
protected DnsResponse decodeResponse(ChannelHandlerContext ctx, DatagramPacket packet) throws Exception
isSharableback to summary
public boolean isSharable()

Overrides default io.netty5.channel.ChannelHandler.isSharable.

Doc from io.netty5.channel.ChannelHandler.isSharable.

Returns true if this handler is sharable and thus can be added to more than one ChannelPipeline. By default, this method returns false. If this method returns false, you have to create a new handler instance every time you add it to a pipeline because it has unshared state such as member variables.

Annotations
@Override