QCoapReply Class▲
-
Header: QCoapReply
-
qmake: QT += coap
-
Inherits: QIODevice
-
Inherited By: QCoapResourceDiscoveryReply
Detailed Description▲
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▲
See also QCoapClient, QCoapRequest, QCoapResourceDiscoveryReply
Member Function Documentation▲
[override virtual] QCoapReply::~QCoapReply()▲
Destroys the QCoapReply and aborts the request if its response has not yet been received.
void QCoapReply::abortRequest()▲
Aborts the request immediately and emits the aborted(const QCoapToken &token) signal if the request was not finished.
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.
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▲
See also finished(), error()
int QCoapReply::errorReceived() const▲
Returns the error of the reply or QCoapReply::NoError if there is no error.
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.
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▲
See also QCoapClient::finished(), isFinished(), notified(), aborted()
bool QCoapReply::isAborted() const▲
Returns true if the request has been aborted.
bool QCoapReply::isFinished() const▲
bool QCoapReply::isRunning() const▲
Returns true if the request is running.
bool QCoapReply::isSuccessful() const▲
Returns true if the request finished with no error.
int QCoapReply::message() const▲
Returns the contained message.
int QCoapReply::method() const▲
Returns the method of the associated request.
int QCoapReply::request() const▲
Returns the associated request.
int QCoapReply::responseCode() const▲
Returns the response code of the request.
QUrl QCoapReply::url() const▲
Returns the target uri of the associated request.