The QCoapReply class holds the data of a CoAP reply. More...
Header: | #include <QCoapReply> |
qmake: | QT += coap |
Inherits: | QIODevice |
Inherited By: |
Note: All functions in this class are reentrant.
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) |
The QCoapReply contains data related to a request sent with the QCoapClient.
The finished() signal is emitted when the response is fully received or when the request fails.
For Observe requests specifically, the notified() signal is emitted whenever a notification is received.
See also QCoapClient, QCoapRequest, and QCoapResourceDiscoveryReply.
[signal]
void QCoapReply::aborted(const QCoapToken &token)
This signal is emitted when the request is aborted or the reply is deleted. Its token parameter is the token of the exchange that has been aborted.
Note: If the QCoapReply is deleted while not finished, both aborted() and finished() signal will be emitted immediately before the QCoapReply is destroyed. Given the QCoapReply may have been deleted when receiving the signal, you should not rely on the sender() object to be still valid.
See also finished() and error().
[signal]
void QCoapReply::error(QCoapReply *reply, QtCoap::Error error)
This signal is emitted whenever an error occurs and is followed by the finished() signal.
Its reply parameters is the QCoapReply itself for convenience, and the error parameter is the error received.
See also finished() and aborted().
[signal]
void QCoapReply::finished(QCoapReply *reply)
This signal is emitted whenever the corresponding request finished, whether successfully or not. When a resource is observed, this signal will only be emitted once, when the observation ends.
The reply parameter is the QCoapReply itself for convenience.
Note: If the QCoapReply is deleted while not finished, both aborted() and finished() signal will be emitted immediately before the QCoapReply is destroyed. Given the QCoapReply may have been deleted when receiving the signal, you should not rely on the reply to be still valid.
See also QCoapClient::finished(), isFinished(), notified(), and aborted().
[signal]
void QCoapReply::notified(QCoapReply *reply, const QCoapMessage &message)
This signal is emitted whenever a notification is received from an observed resource.
Its message parameter is a QCoapMessage containing the payload and the message details. The reply parameter is the QCoapReply itself for convenience.
See also QCoapClient::finished(), isFinished(), finished(), and notified().
[override virtual]
QCoapReply::~QCoapReply()
Destroys the QCoapReply and aborts the request if its response has not yet been received.
Aborts the request immediately and emits the aborted(const QCoapToken &token) signal if the request was not finished.
Returns the error of the reply or QCoapReply::NoError if there is no error.
Returns true
if the request has been aborted.
Returns true
if the request is finished.
See also finished().
Returns true
if the request is running.
Returns true
if the request finished with no error.
Returns the contained message.
Returns the method of the associated request.
Returns the associated request.
Returns the response code of the request.
Returns the target uri of the associated request.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.2/qcoapreply.html