Qt Multicast and Broadcast



  • In my code,receive two kinds of data broadcast and multicast.If using multicast, broadcast data sent to bind port, multicast will receive.I don't know Why?I don't want to receive the broadcast data.

    Someone encountered this problem?
    @
    if (doMulticast){

         m_recvRawSock.bind(Port, QUdpSocket::ShareAddress);
         m_recvRawSock.joinMulticastGroup(QHostAddress(groupAddress));
         connect(&m_recvRawSock,SIGNAL(readyRead()),this,SLOT(process()));
    

    }
    else {

        m_recvRawSock.bind(QHostAddress::Any,Port);
        connect(&m_recvRawSock,SIGNAL(readyRead()),this,SLOT(process()));
    

    }@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.