QCoapReply Class

QCoapReply 클래스는 CoAP 응답의 데이터를 보유합니다. 더 보기...

헤더: #include <QCoapReply>
CMake: find_package(Qt6 REQUIRED COMPONENTS Coap)
target_link_libraries(mytarget PRIVATE Qt6::Coap)
qmake: QT += coap
상속합니다: QIODevice
상속 대상:

QCoapResourceDiscoveryReply

참고: 이 클래스의 모든 함수는 재진입합니다.

공용 함수

virtual ~QCoapReply() override
void abortRequest()
QtCoap::Error errorReceived() const
bool isAborted() const
bool isFinished() const
bool isRunning() const
bool isSuccessful() const
QCoapMessage message() const
QtCoap::Method method() const
QCoapRequest request() const
QtCoap::ResponseCode responseCode() const
QUrl url() const

Signals

void aborted(const QCoapToken &token)
void error(QCoapReply *reply, QtCoap::Error error)
void finished(QCoapReply *reply)
void notified(QCoapReply *reply, const QCoapMessage &message)

상세 설명

QCoapReply는 QCoapClient 로 전송된 요청과 관련된 데이터를 포함합니다.

finished() 신호는 응답이 완전히 수신되거나 요청이 실패할 때 발생합니다.

특히 Observe 요청의 경우 알림이 수신될 때마다 notified() 신호가 전송됩니다.

QCoapClient, QCoapRequest, QCoapResourceDiscoveryReply참조하세요 .

멤버 함수 문서

[override virtual noexcept] QCoapReply::~QCoapReply()

QCoapReply 을 삭제하고 아직 응답이 수신되지 않은 경우 요청을 중단합니다.

void QCoapReply::abortRequest()

요청이 완료되지 않은 경우 즉시 요청을 중단하고 aborted(const QCoapToken &token) 신호를 전송합니다.

[signal] void QCoapReply::aborted(const QCoapToken &token)

이 신호는 요청이 중단되거나 응답이 삭제될 때 발생합니다. token 매개변수는 중단된 거래소의 토큰입니다.

참고: QCoapReply 가 완료되지 않은 상태에서 삭제되면 QCoapReply 가 삭제되기 직전에 aborted() 및 finished() 신호가 모두 전송됩니다. 신호를 수신할 때 QCoapReply 가 삭제되었을 수 있으므로 sender() 객체가 여전히 유효하다고 믿어서는 안 됩니다.

finished() 및 error()도 참조하세요 .

[signal] void QCoapReply::error(QCoapReply *reply, QtCoap::Error error)

이 신호는 오류가 발생할 때마다 전송되며 finished() 신호가 뒤따릅니다.

reply 매개 변수는 편의를 위해 QCoapReply 자체이며 error 매개 변수는 수신된 오류입니다.

finished() 및 aborted()도 참조하세요 .

QtCoap::Error QCoapReply::errorReceived() const

응답의 오류를 반환하거나 오류가 없는 경우 QCoapReply::NoError를 반환합니다.

[signal] void QCoapReply::finished(QCoapReply *reply)

이 신호는 해당 요청이 성공 여부와 관계없이 완료될 때마다 발생합니다. 리소스가 관찰되는 경우 이 신호는 관찰이 종료될 때 한 번만 발생합니다.

reply 매개 변수는 편의를 위해 QCoapReply 자체입니다.

참고: QCoapReply 가 완료되지 않은 상태에서 삭제되면 aborted() 및 finished() 신호가 모두 QCoapReply 가 소멸되기 직전에 발생합니다. 신호를 수신할 때 QCoapReply 이 삭제되었을 수 있으므로 reply 이 여전히 유효하다고 믿어서는 안 됩니다.

QCoapClient::finished(), isFinished(), notified() 및 aborted()도 참조하세요 .

bool QCoapReply::isAborted() const

요청이 중단된 경우 true 을 반환합니다.

bool QCoapReply::isFinished() const

요청이 완료되면 true 을 반환합니다.

finished()도 참조하세요 .

bool QCoapReply::isRunning() const

요청이 실행 중이면 true 을 반환합니다.

bool QCoapReply::isSuccessful() const

요청이 오류 없이 완료되면 true 을 반환합니다.

QCoapMessage QCoapReply::message() const

포함된 메시지를 반환합니다.

QtCoap::Method QCoapReply::method() const

연관된 요청의 메서드를 반환합니다.

[signal] void QCoapReply::notified(QCoapReply *reply, const QCoapMessage &message)

이 신호는 관찰된 리소스에서 알림이 수신될 때마다 전송됩니다.

message 매개 변수는 페이로드와 메시지 세부 정보가 포함된 QCoapMessage 입니다. reply 매개 변수는 편의를 위해 QCoapReply 자체입니다.

QCoapClient::finished(), isFinished(), finished() 및 notified()도 참조하세요 .

QCoapRequest QCoapReply::request() const

관련 요청을 반환합니다.

QtCoap::ResponseCode QCoapReply::responseCode() const

요청의 응답 코드를 반환합니다.

QUrl QCoapReply::url() const

연관된 요청의 대상 URL을 반환합니다.

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