다른 프로세스가 이미 지정된 포트에 바인딩되어있는 경우 QT5.2가 설치된 Windows에서 간단한 코드가 실패합니다. ShareAddress 플래그는 바인딩을 여러 번 허용해야합니다. MacOSX에서는 잘 작동합니다.ShareAddress가있는 멀티 캐스트 용 QUdpSocket 바인드가 실패합니다.
if (false == bind(QHostAddress::AnyIPv4, port_, QUdpSocket::ShareAddress))
{
qDebug() << "Warn: cannot bind to the multicast port " << port_;
qDebug() << error();
}
joinMulticastGroup(QHostAddress(address_));
QT의 버그입니까? 그렇다면 해결 방법이 있습니까?
감사합니다.
감사합니다. QUdpSocket :: ReuseAddressHint를 추가하면 Windows에서 정상적으로 작동합니다. –