#pragma once #include #include #include #include #include class UdpReceiver : public QObject { Q_OBJECT public: explicit UdpReceiver(QObject* parent = nullptr); bool Bind(const QHostAddress& address, quint16 port) { return udpSocket_->bind(address, port); } Q_SIGNALS: void Received(QByteArray datagram); private slots: void OnHandleReadyRead(); private: QUdpSocket* udpSocket_; };