aboutsummaryrefslogtreecommitdiffstats
path: root/src/coap/qcoapqudpconnection_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/coap/qcoapqudpconnection_p.h')
-rw-r--r--src/coap/qcoapqudpconnection_p.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/coap/qcoapqudpconnection_p.h b/src/coap/qcoapqudpconnection_p.h
index 3901af8..1ac1603 100644
--- a/src/coap/qcoapqudpconnection_p.h
+++ b/src/coap/qcoapqudpconnection_p.h
@@ -31,7 +31,6 @@
#ifndef QCOAPQUDPCONNECTION_P_H
#define QCOAPQUDPCONNECTION_P_H
-#include <QtCoap/qcoapqudpconnection.h>
#include <QtCoap/qcoapsecurityconfiguration.h>
#include <private/qcoapconnection_p.h>
@@ -53,6 +52,40 @@ QT_BEGIN_NAMESPACE
class QDtls;
class QSslPreSharedKeyAuthenticator;
+class QCoapQUdpConnectionPrivate;
+class Q_AUTOTEST_EXPORT QCoapQUdpConnection : public QCoapConnection
+{
+ Q_OBJECT
+
+public:
+ explicit QCoapQUdpConnection(QtCoap::SecurityMode security = QtCoap::SecurityMode::NoSec,
+ QObject *parent = nullptr);
+
+ ~QCoapQUdpConnection() override = default;
+
+ QUdpSocket *socket() const;
+
+public Q_SLOTS:
+ void setSocketOption(QAbstractSocket::SocketOption, const QVariant &value);
+
+#if QT_CONFIG(dtls)
+private Q_SLOTS:
+ void pskRequired(QSslPreSharedKeyAuthenticator *authenticator);
+ void handshakeTimeout();
+#endif
+
+protected:
+ explicit QCoapQUdpConnection(QCoapQUdpConnectionPrivate &dd, QObject *parent = nullptr);
+
+ void bind(const QString &host, quint16 port) override;
+ void writeData(const QByteArray &data, const QString &host, quint16 port) override;
+ void close() override;
+
+ void createSocket();
+
+ Q_DECLARE_PRIVATE(QCoapQUdpConnection)
+};
+
class Q_AUTOTEST_EXPORT QCoapQUdpConnectionPrivate : public QCoapConnectionPrivate
{
public: