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
1 answer

QT 5.0 Qudpsocket wont trigger waitforbyteswritten

I have bound a udp socket and i am trying to write a udp datagram for a specific adress so here is my code: UDP::UDP(QObject *parent) : QObject(parent) { socket = new QUdpSocket(this); …
user1553386
  • 143
  • 1
  • 1
  • 8
1
vote
1 answer

QUdpSocket HeartBeat behaviour

I need to send the status of my Qt application through and Upd socket every seconds. How can I achive this? Should I subclass QThread e using QThread::sleep or is there a best approch ? thanks
Blackbelt
  • 156,034
  • 29
  • 297
  • 305
1
vote
1 answer

How to connect a server and a client that is behind router using QUdpSocket?

Assume that I have a server directly connected to internet and a client connected to a router. The client can send messages to server since it knows the server's IP address and port. But how does the server send message back to the client? It can…
user1475966
  • 79
  • 1
  • 4
0
votes
0 answers

Can I listen primary machine's UDP Protocol in second machine without primary's machine receiving UDP protokol?

I have two PCs. One of them primary PC and have a UDP socket from sensor and getting packets. I want to save the packets in another (secondary) PC. But i don't want to broadcast to packets to all PCs those only primary PC will get packets, secondary…
0
votes
1 answer

How to use QUdpSocket to receive large batches of data?

I am using QUdpSocket to receive data, the peer sent 8000 UDP datagrams in a very short time, each datagram contains 1024 bytes of data My QT code is implemented like this connect(udp_socket, SIGNAL(readyRead()), this, SLOT(ReceiveUdp())); void…
0
votes
0 answers

how to bind my ip address to a udp server in qt creator

I want to code a UDP server and I want to use my IP address as the address of the server without putting the code the address in raw. myIP="192.168.1.38"; is there any way to get the IP of the host machine ? i know that QHostAddress::LocalHost is…
0
votes
0 answers

chat app based on UDP in java: Problem on Thread Send and Recieve. when I start application thread recieve don't let thread send to finish

I work on a project to make a chat app using udp (datagramsockets) in java. the idea is multiple clients can communicate with each other with intermediate a server, server here get message from client1 and send to the destination, and this…
0
votes
0 answers

I Am Getting Error in UDP Socket Programming For Calculator

I Am Getting Error in UDP Socket Programming For Calculator How TO solve below mention error i am facing issue in connection This Is client side code enter image description here This Is server side code page 1 page 2 I Am Receiving This Error Any…
0
votes
0 answers

QT writeDatagram function return -1 when I tried to send data to specific IP Address

I want to sending 8 byte data from PC(Linux) to another device. PC(Linux) IP : 10.100.40.99 Another Device IP: 10.100.40.62 Port: 7070 udpPacket_t udpPacket; udpPacket.byte0 = 0x00; udpPacket.byte1 = 0x00; udpPacket.byte2 = 0x00; udpPacket.byte3…
Cevdet
  • 69
  • 9
0
votes
1 answer

QUdpSocket broadcast not working to more than one client

I have an application that uses QUdpSocket to broadcast a heartbeat message: mpsckUDP = new QUdpSocket(this); mpsckUDP->bind(QHostAddress::Broadcast, clsMainWnd::mscuint16Port); QObject::connect(mpsckUDP, SIGNAL(readyRead()), this,…
SPlatten
  • 5,334
  • 11
  • 57
  • 128
0
votes
0 answers

QUdpSocket in Pyside6 is not emitting readReady while equivalent code in QT C++ application works well

I am converting my simple Udp Client application which is working on the Qt C++ but when I try to achieve the same behaviour on the Pyside6 readyRead is not triggered even though the socket seems to be in the ConnectedState. I am using Windows…
bgorkhe
  • 321
  • 3
  • 13
0
votes
1 answer

QUdpSocket readReady not emitting signal

I'm just getting started with implementing a UDP client for my Qt application. I followed this example. I am able to send data to and receive data from a remote host. This has been verified at my remote host as well as the local client that I am…
kubiej21
  • 700
  • 4
  • 14
  • 29
0
votes
1 answer

Qt UDP Socket: How to continuously send request and get response

I Have a QT UDP Client and Server program SERVER code main.cpp #include #include "myserver.h" int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); MyServer myserver; return…
Nostalgic
  • 300
  • 1
  • 4
  • 18
0
votes
1 answer

Receive data from specific address using QUdpSocket

I'm trying to do a client-to-client communication over UDP. I'm using QUdpSocket to do that. The IP of my first client is 127.0.0.2 and the IP of the second client is 127.0.0.3. In my first client, I want to send data, so I'm doing this: socket =…
Clore Nora
  • 137
  • 2
  • 10
0
votes
1 answer

Convert Union to QByteArray and vice-versa using QUdpSocket in Qt

I have one Union like below #define no_of_bits 240 #define word_size 16 struct bits { unsigned short int bit1:1; unsigned short int bit2:1; unsigned short int bit3:1; unsigned short int bit4:1; unsigned short int bit5:1; …
Vinay Kumar
  • 674
  • 2
  • 9
  • 21