En esta página

QDnsServiceRecord Class

La clase QDnsServiceRecord almacena información sobre un registro DNS SRV. Más...

Cabecera: #include <QDnsServiceRecord>
CMake: find_package(Qt6 REQUIRED COMPONENTS Network)
target_link_libraries(mytarget PRIVATE Qt6::Network)
qmake: QT += network

Funciones Públicas

QDnsServiceRecord()
QDnsServiceRecord(const QDnsServiceRecord &other)
~QDnsServiceRecord()
QString name() const
quint16 port() const
quint16 priority() const
void swap(QDnsServiceRecord &other)
QString target() const
quint32 timeToLive() const
quint16 weight() const
QDnsServiceRecord &operator=(const QDnsServiceRecord &other)

Descripción detallada

Cuando se realiza una búsqueda en un servicio, se devuelven cero o más registros. Cada registro está representado por una instancia de QDnsServiceRecord.

El significado de los campos se define en RFC 2782.

Véase también QDnsLookup.

Documentación de las funciones de los miembros

QDnsServiceRecord::QDnsServiceRecord()

Construye un objeto de registro de servicio vacío.

QDnsServiceRecord::QDnsServiceRecord(const QDnsServiceRecord &other)

Construye una copia de other.

[noexcept] QDnsServiceRecord::~QDnsServiceRecord()

Destruye un registro de servicio.

QString QDnsServiceRecord::name() const

Devuelve el nombre de este registro.

quint16 QDnsServiceRecord::port() const

Devuelve el puerto en el host de destino para este registro de servicio.

quint16 QDnsServiceRecord::priority() const

Devuelve la prioridad de este registro de servicio.

Un cliente debe intentar ponerse en contacto con el host de destino con la prioridad más baja.

[noexcept] void QDnsServiceRecord::swap(QDnsServiceRecord &other)

Intercambia esta instancia de registro de servicio con other. Esta operación es muy rápida y nunca falla.

QString QDnsServiceRecord::target() const

Devuelve el nombre de dominio del host de destino para este registro de servicio.

quint32 QDnsServiceRecord::timeToLive() const

Devuelve la duración en segundos para la que este registro es válido.

quint16 QDnsServiceRecord::weight() const

Devuelve el peso de este registro de servicio.

El campo peso especifica un peso relativo para las entradas con la misma prioridad. Las entradas con pesos más altos deberían seleccionarse con una probabilidad mayor.

QDnsServiceRecord &QDnsServiceRecord::operator=(const QDnsServiceRecord &other)

Asigna los datos del objeto other a este objeto de registro y devuelve una referencia al mismo.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.