QDnsServiceRecord 類

QDnsServiceRecord 類存儲有關 DNS SRV 記錄的信息。 更多...

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

公共函數

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 )

詳細描述

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 ()

Constructs an empty service record object.

QDnsServiceRecord:: QDnsServiceRecord (const QDnsServiceRecord & other )

構造副本為 other .

[noexcept] QDnsServiceRecord:: ~QDnsServiceRecord ()

Destroys a service record.

QString QDnsServiceRecord:: 名稱 () 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.

[noexcept] 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.

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

賦值數據源於 other 對象到此記錄對象,並返迴它的引用。