aboutsummaryrefslogtreecommitdiffstats
path: root/src/coap/qcoapprotocol.cpp
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-01-30 17:36:34 +0100
committerSona Kurazyan <sona.kurazyan@qt.io>2019-02-05 15:56:43 +0000
commit1651e8c4e2c7bba06acb33d4bb7df3583e69c3f4 (patch)
treee054b4a6d33eb963df4d6517d541a0c4e654666a /src/coap/qcoapprotocol.cpp
parent14b68fb394b0d02f672c2c8340c32580d007d2ba (diff)
Use function pointer syntax for connect statements
Change-Id: I0fe67e7307f67543f0c63a5be46b92f2dd074d45 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Diffstat (limited to 'src/coap/qcoapprotocol.cpp')
-rw-r--r--src/coap/qcoapprotocol.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/coap/qcoapprotocol.cpp b/src/coap/qcoapprotocol.cpp
index 8635841..d01e50c 100644
--- a/src/coap/qcoapprotocol.cpp
+++ b/src/coap/qcoapprotocol.cpp
@@ -87,6 +87,11 @@ void QCoapProtocol::sendRequest(QPointer<QCoapReply> reply, QCoapConnection *con
if (reply.isNull() || !reply->request().isValid())
return;
+ connect(reply, &QCoapReply::aborted, this, [this](const QCoapToken &token) {
+ Q_D(QCoapProtocol);
+ d->onRequestAborted(token);
+ });
+
auto internalRequest = QSharedPointer<QCoapInternalRequest>::create(reply->request(), this);
internalRequest->setMaxTransmissionWait(maxTransmitWait());
connect(reply, &QCoapReply::finished, this, &QCoapProtocol::finished);
@@ -114,11 +119,16 @@ void QCoapProtocol::sendRequest(QPointer<QCoapReply> reply, QCoapConnection *con
else
internalRequest->setTimeout(maxTimeout());
- connect(internalRequest.data(), SIGNAL(timeout(QCoapInternalRequest *)),
- this, SLOT(onRequestTimeout(QCoapInternalRequest *)));
- connect(internalRequest.data(), SIGNAL(maxTransmissionSpanReached(QCoapInternalRequest *)),
- this, SLOT(onRequestMaxTransmissionSpanReached(QCoapInternalRequest *)));
-
+ connect(internalRequest.data(), &QCoapInternalRequest::timeout,
+ [this](QCoapInternalRequest *request) {
+ Q_D(QCoapProtocol);
+ d->onRequestTimeout(request);
+ });
+ connect(internalRequest.data(), &QCoapInternalRequest::maxTransmissionSpanReached,
+ [this](QCoapInternalRequest *request) {
+ Q_D(QCoapProtocol);
+ d->onRequestMaxTransmissionSpanReached(request);
+ });
d->sendRequest(internalRequest.data());
}
@@ -223,6 +233,7 @@ void QCoapProtocolPrivate::onRequestError(QCoapInternalRequest *request, QtCoap:
forgetExchange(request);
emit q->error(userReply.data(), error);
}
+
/*!
\internal