Added minimal UDP client and server examples

This commit is contained in:
Tuomas Järvinen
2024-07-04 13:51:19 +03:00
parent f4027094f1
commit aae3e87116
6 changed files with 136 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#pragma once
#include <QObject>
#include <QUdpSocket>
#include <QJsonDocument>
class UdpServer : public QObject
{
Q_OBJECT
public:
explicit UdpServer(int portNumber, QObject *parent = nullptr);
private slots:
void readPendingDatagrams();
private:
QUdpSocket *mUdpSocket;
signals:
void newJsonDocument(QJsonDocument);
};