examples/network/broadcastreceiver/receiver.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    50     statusLabel = new QLabel(tr("Listening for broadcasted messages"));
    50     statusLabel = new QLabel(tr("Listening for broadcasted messages"));
    51     quitButton = new QPushButton(tr("&Quit"));
    51     quitButton = new QPushButton(tr("&Quit"));
    52 
    52 
    53 //! [0]
    53 //! [0]
    54     udpSocket = new QUdpSocket(this);
    54     udpSocket = new QUdpSocket(this);
    55     udpSocket->bind(45454);
    55     udpSocket->bind(45454, QUdpSocket::ShareAddress);
    56 //! [0]
    56 //! [0]
    57 
    57 
    58 //! [1]
    58 //! [1]
    59     connect(udpSocket, SIGNAL(readyRead()),
    59     connect(udpSocket, SIGNAL(readyRead()),
    60             this, SLOT(processPendingDatagrams()));
    60             this, SLOT(processPendingDatagrams()));