aboutsummaryrefslogtreecommitdiffstats
path: root/src/coap/qcoapclient.cpp
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-04-01 18:13:57 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2019-04-25 06:36:27 +0000
commite2faedb48d9bbfde275bec22aebb5c1ded430e2c (patch)
tree9b622bc2950a600cf80c3d65342b06158d7f5c7c /src/coap/qcoapclient.cpp
parentcf5699e4050b200b9ee80bf4a1c8fbcecb2877af (diff)
Add an API for closing the connection's transport
Change-Id: I916ddb226b653aaf563ecf0adc3a1110d6da3132 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/coap/qcoapclient.cpp')
-rw-r--r--src/coap/qcoapclient.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/coap/qcoapclient.cpp b/src/coap/qcoapclient.cpp
index b438ba6..d56b072 100644
--- a/src/coap/qcoapclient.cpp
+++ b/src/coap/qcoapclient.cpp
@@ -508,6 +508,15 @@ void QCoapClient::cancelObserve(const QUrl &url)
}
/*!
+ Closes the open sockets and connections to free the transport.
+*/
+void QCoapClient::disconnect()
+{
+ Q_D(QCoapClient);
+ QMetaObject::invokeMethod(d->connection, "disconnect", Qt::QueuedConnection);
+}
+
+/*!
\internal
Sends the CoAP \a request to its own URL and returns a new QCoapReply