I use QUDPsocket to send message. And I connect: connect(socket,SIGNAL(ReadyRead()),this,SLOT(processPendingDatagrams()));
when I call the sendmessage("123") in the main,the processPendingDatagrams() only run once.
but when I call the sendmessage("123") in the button click event, this runs twice . how to solve the problem?
sendmessage():
socket->writeDatagram(data,data.length(),QHostAddress::Broadcast, port);