Skip to content
This repository has been archived by the owner on Feb 9, 2018. It is now read-only.

Commit

Permalink
Fix for UPnP listener not listening, which erroneously caused PMS to
Browse files Browse the repository at this point in the history
only detect devices when an ALIVE message was sent.

Apparently forcing the network interface on a MulticastSocket created
by port is okay with Java 1.6.0_45 on Mac OSX (it was removed for that
reason in 98c85bc).
  • Loading branch information
Raptor399 committed Apr 28, 2013
1 parent 6fc8d8f commit 299201f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/net/pms/network/UPNPHelper.java
Expand Up @@ -360,6 +360,15 @@ public void run() {
LOGGER.warn("Finally, acquiring port " + PMS.getConfiguration().getUpnpPort() + " was successful!");
}

NetworkInterface ni = NetworkConfiguration.getInstance().getNetworkInterfaceByServerName();

if (ni != null) {
multicastSocket.setNetworkInterface(ni);
} else if (PMS.get().getServer().getNetworkInterface() != null) {
LOGGER.trace("Setting multicast network interface: " + PMS.get().getServer().getNetworkInterface());
multicastSocket.setNetworkInterface(PMS.get().getServer().getNetworkInterface());
}

multicastSocket.setTimeToLive(4);
multicastSocket.setReuseAddress(true);
InetAddress upnpAddress = getUPNPAddress();
Expand Down

0 comments on commit 299201f

Please sign in to comment.