qudpsocket

QUdpSocket not working without bind

假如想象 提交于 2019-12-24 08:14:39
问题 I have to communicate with some device over UDP. The problem is that QUdpSocket doesn't not work at all without special case of bind(). I use the connectToHost() method for access to read()/write() functions. UDP exchange not working at all when using the code: m_udp.connectToHost(QHostAddress("192.168.100.15"), 4001); m_udp.waitForConnected(); The I don't receive any bytes. Message in Wireshark: The below code doesn't work too: m_udp.bind(QHostAddress("192.168.100.15"), 4001); m_udp

QUdpSocket is not properly sending messages from server to client

被刻印的时光 ゝ 提交于 2019-12-11 16:44:21
问题 I am building a user interface Server/Client. In order to replicate the problem I prepared a MVCE that replicates the problem I have. The GUI is described as follows: the Server machine has a QGraphicsView where there are N.1 green square moving within the boundaries of the QGraphicsScene and an obstacle. As soon as the square hits either the boundaries or the obstacle, the server machine should send a message to the client with the coordinates of the collision. In order to run the example

Qt QUdpSocket: readyRead() signal and corresponding slot not working as supposed

瘦欲@ 提交于 2019-12-08 02:17:13
问题 I have problems to find why my short QUdpSocket example is not working. I plan to use only one UDP socket to read and write to an embedded device at 192.168.2.66 on port 2007. The device will reply always on port 2007 to the sender. I tested the device with an UDP terminal software and works as I said. So, I designed a simple class to embed the functions needed to manage the device: class QUdp : public QObject { // Q_OBJECT public: explicit QUdp(QObject *parent = 0, const char *szHost = 0,

Qt QUdpSocket: readyRead() signal and corresponding slot not working as supposed

时光毁灭记忆、已成空白 提交于 2019-12-06 12:57:19
I have problems to find why my short QUdpSocket example is not working. I plan to use only one UDP socket to read and write to an embedded device at 192.168.2.66 on port 2007. The device will reply always on port 2007 to the sender. I tested the device with an UDP terminal software and works as I said. So, I designed a simple class to embed the functions needed to manage the device: class QUdp : public QObject { // Q_OBJECT public: explicit QUdp(QObject *parent = 0, const char *szHost = 0, uint16_t wPort = 0); ~QUdp(); bool Open(); int64_t Write(QByteArray &data); int64_t Write(QString strData