mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-23 01:56:34 +00:00
Added minimal UDP client and server examples
This commit is contained in:
@@ -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);
|
||||
};
|
||||
Reference in New Issue
Block a user