Questions tagged [qudpsocket]

The QUdpSocket class provides a UDP socket

UDP (User Datagram Protocol) is a lightweight, unreliable, datagram-oriented, connectionless protocol. It can be used when reliability isn't important. QUdpSocket is a subclass of QAbstractSocket that allows you to send and receive UDP datagrams.

74 questions
1
vote
0 answers

Is a manual QUdpSocket implementation right for image streaming? or are there better ways?

I'm creating a remote viewer for an image processing application and need to send the results over the network so they can be recorded. I'm currently trying to stream the images with a UDP socket based on QUpdSocket. UDP is fine because I don't need…
fooforever
  • 379
  • 1
  • 3
  • 14
1
vote
1 answer

Packets sent from QUdpSocket are not seen in Wireshark

I'm trying to see my outgoing UDP traffic in Wireshark. I created new socket and bind it to my QHostAddress::LocalHost with no errors. I then sent some data writeDatagram and the return value is correct, but I see no outgoing traffic in Wireshark.…
Milo
  • 51
  • 5
1
vote
2 answers

QUdpSocket not working without bind

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…
Vladimir Bershov
  • 2,701
  • 2
  • 21
  • 51
1
vote
1 answer

How to make UDP "client" in Qt so that he receives data from server?

So, UDP server apparently just listens on some port and handles byte arrays which come with IP and PORT of the source: // In this code, listener is QUdpSocket* FileServer::FileServer(QObject *parent) : QObject(parent) , listener(new…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
1
vote
2 answers

How to properly create QUdpSocket on non-gui thread ? Readyread not emitted

I'm writing a network library that wraps the QUdpSocket: QAbstractSocket *UdpNetworkStreamer::addConnection() { QUdpSocket *udpSocket = new QUdpSocket(this); udpSocket->bind(connection.port, QUdpSocket::ShareAddress); bool ret =…
Adiel Yaacov
  • 1,401
  • 3
  • 14
  • 24
1
vote
2 answers

QUdpSocket client-server remote host not connectable

I've seen few threads about my question, but, still I can't seem to solve the problem, and the replies are not sufficient. So here is the task: I have 2 PCs. One must transmit 100 udp packets, with a simple test data, and the other machine must read…
Ilian Zapryanov
  • 1,132
  • 2
  • 16
  • 28
1
vote
1 answer

QUdpSocket High rate message reading

everybody! I have a strange issue in working with QUdpSocket and readyRead signal, I can say it's not working as I think, I create a QUdpSocket and bind it to some port , connect the readyRead signal to my slot and I read all the pending datagram as…
danics
  • 323
  • 1
  • 9
1
vote
1 answer

Send a Struct via UDP

I would like to send a struct via a QUdpSocket. I know I should use QDataStream and QByteArray, but I can't because the receiver will not use Qt. I tried many things, but I never find something that seems to do the work properly. My struct will be…
0xPunt
  • 313
  • 1
  • 4
  • 21
1
vote
0 answers

Qt QAudioInput how to send a fixed number of samples

I'm tryng to send some audio stream from my Qt application to an other device with the udp protocol. My problem is that the target device wants a fixed number of samples(in my case 320) for every packet it receives. To do that I think I must use the…
user3532190
  • 45
  • 1
  • 8
1
vote
1 answer

Broadcast large data with Qt sockets

I'm using QT. I need to broadcast data, so I try to use QUdpSocket. But data can be too big(after writeDatagram QUdpSocket::error returns DatagramTooLargeError). So I split data and call writeDatagram several times to the parts. But Received socket…
Hate
  • 1,185
  • 3
  • 12
  • 24
1
vote
2 answers

QUdpSocket doesn't emit readyRead() signal

I faced a problem with QUdpSocket. Signal readyRead() seems to be never emitted. So, I decided to create QTimer and check state of socket reading queue. That way I ensured that socket working properly (bytesAvailable() shows number of bytes) and…
user3243625
  • 49
  • 2
  • 3
1
vote
0 answers

BootP and UDP socket communication with Qt

I'm building a computer client that receives data from a medical patient monitor over UDP IP. I'm using QTs API and hence the QUdpSocket class to establish the communication. The monitor I want to recieve data from is dependent on a BootP server to…
Morten
  • 31
  • 3
1
vote
2 answers

QUdpSocket: How to make multicast work also on localhost but prevent loopback per application?

My Qt application uses multicast QUdpSocket and need half-duplex operation (it simulates radio transfer between simplex radiostations). It means that one application instance must not receive datagrams it sends. But also it must support working…
Artem Pisarenko
  • 123
  • 1
  • 2
  • 13
1
vote
0 answers

QUdpSocket sending malformed packets

I am setting up a QUdpSocket broadcaster. when I view the output in wireshark, it says my packets are malformed. Inspecting the packets, it appears they are not emitted with an ethernet trailer. Do I need to emit this myself, or do you see…
user2025983
  • 178
  • 10
1
vote
0 answers

Qt5 slot being called multiple times from a single emit statement

I'm relatively new to Qt, but I have done a little searching around. I have a base class that handles UDP broadcasting, and does the connect statements in the constructor of the class like this: NetworkConnection::NetworkConnection(QObject…
OzBarry
  • 1,098
  • 1
  • 17
  • 44