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 ?
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";
}
}
void Udp::fnUdpSetting(QString localIP,quint16 multicastPort,QString multicastIP)
{
m_pUdpSockRecv = new QUdpSocket(this);
connect(m_pUdpSockRecv, SIGNAL( readyRead() ), this, SLOT( fnUdpRecvData() ));
if( m_pUdpSockRecv->bind( QHostAddress( localIP ) , multicastPort, QUdpSocket::DefaultForPlatform) ){
if( m_pUdpSockRecv->joinMulticastGroup( QHostAddress( multicastIP ) )) {
qDebug() << "Connection Success";
} else {
qDebug() << "Join Error";
}
}
else {
qDebug() << "Bind Error";
}
}
To copy to clipboard, switch view to plain text mode
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.
Bookmarks