Package org.xbill.DNS
Class NioUdpClient
java.lang.Object
org.xbill.DNS.NioClient
org.xbill.DNS.NioUdpClient
- All Implemented Interfaces:
UdpIoClient
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.xbill.DNS.NioClient
NioClient.KeyProcessor -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final intprivate final Queue<NioUdpClient.Transaction> private final SecureRandomprivate final Queue<NioUdpClient.Transaction> Fields inherited from class org.xbill.DNS.NioClient
REGISTER_SHUTDOWN_HOOK_PROPERTY, SELECTOR_TIMEOUT_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidcloseUdp()private voidprocessPendingRegistrations(Selector selector) CompletableFuture<byte[]> sendAndReceiveUdp(InetSocketAddress local, InetSocketAddress remote, Message query, byte[] data, int max, Duration timeout) Sends a query to a remote server and returns the answer.private static voidsilentCloseChannel(DatagramChannel channel) Methods inherited from class org.xbill.DNS.NioClient
close, runSelector, selector, setCloseTask, setPacketLogger, setRegistrationsTask, setTimeoutTask, verboseLog, verboseLog
-
Field Details
-
ephemeralStart
private final int ephemeralStart -
ephemeralRange
private final int ephemeralRange -
prng
-
registrationQueue
-
pendingTransactions
-
-
Constructor Details
-
NioUdpClient
NioUdpClient()
-
-
Method Details
-
processPendingRegistrations
-
checkTransactionTimeouts
private void checkTransactionTimeouts() -
sendAndReceiveUdp
public CompletableFuture<byte[]> sendAndReceiveUdp(InetSocketAddress local, InetSocketAddress remote, Message query, byte[] data, int max, Duration timeout) Description copied from interface:UdpIoClientSends a query to a remote server and returns the answer.- Specified by:
sendAndReceiveUdpin interfaceUdpIoClient- Parameters:
local- Address from which the connection is coming. may benulland the implementation must decide on the local address.remote- Address that the connection should send the data to.query- DNS message representation of the outbound query.data- Raw byte representation of the outbound query.max- Size of the response buffer.timeout- Duration before the connection will time out and be closed.- Returns:
- A
CompletableFuturethat will be completed with the byte value of the response.
-
silentCloseChannel
-
closeUdp
private void closeUdp()
-