Package org.xbill.DNS
Class NioTcpClient
java.lang.Object
org.xbill.DNS.NioClient
org.xbill.DNS.NioTcpClient
- All Implemented Interfaces:
TcpIoClient
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate classprivate static classNested classes/interfaces inherited from class org.xbill.DNS.NioClient
NioClient.KeyProcessor -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<NioTcpClient.ChannelKey, NioTcpClient.ChannelState> private final Queue<NioTcpClient.ChannelState> Fields inherited from class org.xbill.DNS.NioClient
REGISTER_SHUTDOWN_HOOK_PROPERTY, SELECTOR_TIMEOUT_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidcloseTcp()private voidprocessPendingRegistrations(Selector selector) CompletableFuture<byte[]> sendAndReceiveTcp(InetSocketAddress local, InetSocketAddress remote, Message query, byte[] data, Duration timeout) Sends a query to a remote server and returns the answer.Methods inherited from class org.xbill.DNS.NioClient
close, runSelector, selector, setCloseTask, setPacketLogger, setRegistrationsTask, setTimeoutTask, verboseLog, verboseLog
-
Field Details
-
registrationQueue
-
channelMap
-
-
Constructor Details
-
NioTcpClient
NioTcpClient()
-
-
Method Details
-
processPendingRegistrations
-
checkTransactionTimeouts
private void checkTransactionTimeouts() -
closeTcp
private void closeTcp() -
sendAndReceiveTcp
public CompletableFuture<byte[]> sendAndReceiveTcp(InetSocketAddress local, InetSocketAddress remote, Message query, byte[] data, Duration timeout) Description copied from interface:TcpIoClientSends a query to a remote server and returns the answer.- Specified by:
sendAndReceiveTcpin interfaceTcpIoClient- 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.timeout- Duration before the connection will time out and be closed.- Returns:
- A
CompletableFuturethat will be completed with the byte value of the response.
-