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

public Class DatagramDnsQueryDecoder

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

Decodes a DatagramPacket into a DatagramDnsQuery.

Field Summary

Modifier and TypeField and Description
private final DnsRecordDecoder

Constructor Summary

AccessConstructor and Description
public
public
DatagramDnsQueryDecoder(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.
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

recordDecoderback to summary
private final DnsRecordDecoder recordDecoder

Constructor Detail

DatagramDnsQueryDecoderback to summary
public DatagramDnsQueryDecoder()

Creates a new decoder with the default record decoder.

DatagramDnsQueryDecoderback to summary
public DatagramDnsQueryDecoder(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
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