18 setWindowTitle(
"UdpClient");
20 m_pudp =
new QUdpSocket(
this);
22 connect(m_pudp, SIGNAL(readyRead()), SLOT(slotProcessDatagrams()));
26 void UdpClient::slotProcessDatagrams()
28 QByteArray baDatagram;
30 baDatagram.resize(m_pudp->pendingDatagramSize());
31 m_pudp->readDatagram(baDatagram.data(), baDatagram.size());
32 }
while(m_pudp->hasPendingDatagrams());
35 QDataStream in(&baDatagram, QIODevice::ReadOnly);
36 in.setVersion(QDataStream::Qt_5_3);
38 append(
"Received:" + dateTime.toString());
UdpClient(QWidget *pwgt=0)