No working readyRead() signal in QUdpSocket
Hi,
I want to use QUdpScoket Multicast ,but readyRead() signal don't emit.
Confirming that datagrams can be received at WireShark and SocketDebbugger.
Firewall is Invalidation. Bind, connect, joinMulticast is true. I never get socket errorString.
But readyRead() is don't emit. Why ?
Code:
void Udp
::fnUdpSetting(QString localIP,quint16 multicastPort,
QString multicastIP
) {
connect(m_pUdpSockRecv, SIGNAL( readyRead() ), this, SLOT( fnUdpRecvData() ));
if( m_pUdpSockRecv
->joinMulticastGroup
( QHostAddress( multicastIP
) )) { qDebug() << "Connection Success";
} else {
qDebug() << "Join Error";
}
}
else {
qDebug() << "Bind Error";
}
}
The IP and Port I'm using are
localIP: 192.168.0.122
multicastPort: 49871
multicastIP 239.0.0.15
I don't get any errors or anything, so I have no idea.
Can someone help me?
Thanks.
Re: No working readyRead() signal in QUdpSocket
I'd try to connect to stateChanged and errorOccurred signals of the socket.
Other than that it's hard to say without seeing the rest of the code, maybe you accidentally destroy the socket object somewhere ? first of all, is the event loop running ?