File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ void ProviderPrivate::onMessageReceived(const Message &message)
183183 if (sendTxt) {
184184 reply.addRecord (txtRecord);
185185 }
186- server->sendMessage (reply);
186+ server->sendMessageToAll (reply);
187187 }
188188}
189189
Original file line number Diff line number Diff line change @@ -154,6 +154,13 @@ void Server::sendMessageToAll(const Message &message)
154154{
155155 QByteArray packet;
156156 toPacket (message, packet);
157- d->ipv4Socket .writeDatagram (packet, MdnsIpv4Address, MdnsPort);
158- d->ipv6Socket .writeDatagram (packet, MdnsIpv6Address, MdnsPort);
157+ for (const QNetworkInterface& interface : QNetworkInterface::allInterfaces ()) {
158+ if (interface.flags () & QNetworkInterface::CanMulticast) {
159+ d->ipv4Socket .setMulticastInterface (interface);
160+ d->ipv4Socket .writeDatagram (packet, MdnsIpv4Address, MdnsPort);
161+
162+ d->ipv6Socket .setMulticastInterface (interface);
163+ d->ipv6Socket .writeDatagram (packet, MdnsIpv6Address, MdnsPort);
164+ }
165+ }
159166}
You can’t perform that action at this time.
0 commit comments