Example UDP server project

This commit is contained in:
Ollo
2023-08-13 22:38:07 +02:00
parent 1c3c64f447
commit 3aace88c0b
3 changed files with 62 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
#ifndef UDPSERVER_H
#define UDPSERVER_H
#include <QAbstractItemModel>
#include <QUdpSocket>
class UdpServer : public QAbstractItemModel
{
Q_OBJECT
public:
explicit UdpServer(QObject *parent = nullptr);
private:
void initSocket();
void readPendingDatagrams();
QUdpSocket *mUdpSocket;
void processTheDatagram(QNetworkDatagram datagram);
};
#endif // UDPSERVER_H