code: public List<InetSocketAddress> getSocketAddresses() {
          try {
              InetAddress[] inetAddresses = InetAddress.getAllByName(host);
              List<InetSocketAddress> inetSocketAddressList = new ArrayList<InetSocketAddress>();
              for (InetAddress inetAddress : inetAddresses) {
                  inetSocketAddressList.add(new InetSocketAddress(inetAddress, port));
              }
  
              return inetSocketAddressList;
          } catch (UnknownHostException e) {
              throw new MongoSocketException(e.getMessage(), this, e);
          }
      }
docs: Gets all underlying socket addresses
  
  @return array of socket addresses
  
  @since 3.9