Skip to content

Commit

Permalink
work around problem with multicast addresses
Browse files Browse the repository at this point in the history
In Windows, using setMulticastInterface() is not
sufficient. One need to bind on each address,
else the first address found is used.

Bump version to v0.9.2.
  • Loading branch information
mid1221213 committed Oct 26, 2014
1 parent f7e21f5 commit 3b416a2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Freebox.pluginspec.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<plugin name=\"Freebox\" version=\"0.9.1\" compatVersion=\"0.9.0\">
<plugin name=\"Freebox\" version=\"0.9.2\" compatVersion=\"0.9.0\">
<vendor>Freebox SAS</vendor>
<copyright>(C) Freebox 2014</copyright>
<license>LGPL-2.1</license>
Expand Down
4 changes: 3 additions & 1 deletion ssdp/ssdpclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ void Client::start(const QString &nt)

foreach(QNetworkInterface iface, QNetworkInterface::allInterfaces()) {
mListeners << new UdpListener(iface);
mSearches << new Search(iface, nt);
foreach(QHostAddress addr, iface.allAddresses()) {
mSearches << new Search(iface, addr, nt);
}
}

foreach(UdpListener *l, mListeners) {
Expand Down
3 changes: 2 additions & 1 deletion ssdp/ssdpsearch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ namespace Freebox {
namespace Ssdp {

Search::Search(const QNetworkInterface &iface,
const QHostAddress &addr,
const QString &st,
QObject *parent) :
UdpSocket(parent),
mIface(iface),
mSt(st)
{
if (!bind()) {
if (!bind(addr)) {
qWarning() << "failed bind for SSDP search:" << errorString();
return;
}
Expand Down
1 change: 1 addition & 0 deletions ssdp/ssdpsearch.hh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Search : public UdpSocket
{
public:
Search(const QNetworkInterface &iface,
const QHostAddress &addr,
const QString &st,
QObject *parent = 0);

Expand Down

0 comments on commit 3b416a2

Please sign in to comment.