QDnsServiceRecord 类

QDnsServiceRecord 类存储有关 DNS SRV 记录的信息。 更多...

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

公共函数

  QDnsServiceRecord (const QDnsServiceRecord & other )
  QDnsServiceRecord ()
QDnsServiceRecord & operator= (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

详细描述

When performing a lookup on a service, zero or more records will be returned. Each record is represented by a QDnsServiceRecord instance.

字段含义的定义在 RFC 2782 .

另请参阅 QDnsLookup .

成员函数文档编制

QDnsServiceRecord:: QDnsServiceRecord (const QDnsServiceRecord & other )

构造副本为 other .

QDnsServiceRecord:: QDnsServiceRecord ()

Constructs an empty service record object.

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

赋值数据源于 other 对象到此记录对象,并返回它的引用。

QDnsServiceRecord:: ~QDnsServiceRecord ()

Destroys a service record.

QString QDnsServiceRecord:: name () const

返回此记录的名称。

quint16 QDnsServiceRecord:: port () const

Returns the port on the target host for this service record.

quint16 QDnsServiceRecord:: priority () const

Returns the priority for this service record.

A client must attempt to contact the target host with the lowest-numbered priority.

void QDnsServiceRecord:: swap ( QDnsServiceRecord & other )

Swaps this service record instance with other 。此函数非常快且从不失败。

QString QDnsServiceRecord:: target () const

Returns the domain name of the target host for this service record.

quint32 QDnsServiceRecord:: timeToLive () const

返回此记录有效的持续时间 (以秒为单位)。

quint16 QDnsServiceRecord:: weight () const

Returns the weight for this service record.

The weight field specifies a relative weight for entries with the same priority. Entries with higher weights should be selected with a higher probability.