[Qt-interest] broadcast sender/receiver

linux newbie linux.newbie79 at gmail.com
Thu Sep 30 04:46:37 CEST 2010


Hi,

* I created listener in "C" code and it waits for data on particular port.
* Using Qt I created a Broadcast client and it sends data.
* Listener can able to receive the data and it writes back ack.
* On Client side, the ack is not received.

Below is the client code, can anyone let me know the mistake I made.

Client::Client(QObject *parent)
    :QObject(parent)
{
    QByteArray buffer(CMD_GET_VER_INFO);
udpSocket = new QUdpSocket(this);
udpSocket->bind(BROADCAST_PORT, QUdpSocket::ReuseAddressHint);
udpSocket->writeDatagram(buffer, QHostAddress::Broadcast, BROADCAST_PORT);
connect(udpSocket, SIGNAL(readyRead()), this, SLOT(readData()));
}

Thanks



More information about the Qt-interest-old mailing list