このページでは

QDnsServiceRecord Class

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)

詳細な説明

サービスの検索を実行すると、0 個以上のレコードが返されます。各レコードは、QDnsServiceRecord インスタンスによって表されます。

各フィールドの意味は、RFC 2782 で定義されています。

QDnsLookupも参照してください 。

メンバ関数のドキュメント

QDnsServiceRecord::QDnsServiceRecord()

空のサービスレコードオブジェクトを作成します。

QDnsServiceRecord::QDnsServiceRecord(const QDnsServiceRecord &other)

other のコピーを作成します。

[noexcept] QDnsServiceRecord::~QDnsServiceRecord()

サービス記録を削除します。

QString QDnsServiceRecord::name() const

このレコードの名前を返します。

quint16 QDnsServiceRecord::port() const

このサービスレコードに対応する、ターゲットホスト上のポートを返します。

quint16 QDnsServiceRecord::priority() const

このサービスレコードの優先度を返します。

クライアントは、優先順位が最も低いものから順に、ターゲットホストへの接続を試みなければなりません。

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

このサービスレコードインスタンスを「other 」と入れ替えます。この操作は非常に高速で、失敗することはありません。

QString QDnsServiceRecord::target() const

このサービスレコードの対象ホストのドメイン名を返します。

quint32 QDnsServiceRecord::timeToLive() const

このレコードの有効期間を秒単位で返します。

quint16 QDnsServiceRecord::weight() const

このサービスレコードの重みを返します。

「weight」フィールドは、同じ優先度を持つエントリに対する相対的な重みを指定します。重みが高いエントリほど、選択される確率が高くなります。

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

other オブジェクトのデータをこのレコードオブジェクトに代入し、その参照を返します。

© 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.