이 페이지에서

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

신호

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 이 완료되기 전에 삭제된경우 , QCoapReply 가 소멸되기 직전에 aborted() 및 finished() 신호가 모두 발송됩니다. 신호를 수신할 당시 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(), aborted()도 참조하십시오 .

QCoapRequest QCoapReply::request() const

연관된 요청을 반환합니다.

QtCoap::ResponseCode QCoapReply::responseCode() const

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

QUrl QCoapReply::url() const

연관된 요청의 대상 URI를 반환합니다.

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