Package org.xbill.DNS

Class DefaultIoClient

java.lang.Object
org.xbill.DNS.DefaultIoClient
All Implemented Interfaces:
TcpIoClient, UdpIoClient

public class DefaultIoClient extends Object implements TcpIoClient, UdpIoClient
An implementation of the IO clients that use the internal NIO-based clients.
Since:
3.6
See Also:
  • NioUdpClient
  • NioTcpClient
  • 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: TcpIoClient
      Sends a query to a remote server and returns the answer.
      Specified by:
      sendAndReceiveTcp in interface TcpIoClient
      Parameters:
      local - Address from which the connection is coming. may be null and 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 CompletableFuture that 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: UdpIoClient
      Sends a query to a remote server and returns the answer.
      Specified by:
      sendAndReceiveUdp in interface UdpIoClient
      Parameters:
      local - Address from which the connection is coming. may be null and 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 CompletableFuture that will be completed with the byte value of the response.