Package org.xbill.DNS
Class DefaultIoClient
java.lang.Object
org.xbill.DNS.DefaultIoClient
- All Implemented Interfaces:
TcpIoClient,UdpIoClient
An implementation of the IO clients that use the internal NIO-based clients.
- Since:
- 3.6
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture<byte[]> sendAndReceiveTcp(InetSocketAddress local, InetSocketAddress remote, Message query, byte[] data, Duration timeout) Sends a query to a remote server and returns the answer.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.
-
Constructor Details
-
DefaultIoClient
public DefaultIoClient()
-
-
Method Details
-
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.
-
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.
-