Package org.xbill.DNS.io
Interface TcpIoClient
- All Known Implementing Classes:
DefaultIoClient
public interface TcpIoClient
Serves as an interface from a
Resolver to the underlying mechanism for sending bytes over
the wire as a TCP message.- Since:
- 3.6
-
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.
-
Method Details
-
sendAndReceiveTcp
CompletableFuture<byte[]> sendAndReceiveTcp(InetSocketAddress local, InetSocketAddress remote, Message query, byte[] data, Duration timeout) Sends a query to a remote server and returns the answer.- 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. - Since:
- 3.6
-