Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for UPnP listener not listening, which erroneously caused PMS to

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...
commit 299201fdef7c2252ee1136052471c82a8f5f6c83 1 parent 6fc8d8f
@Raptor399 Raptor399 authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/main/java/net/pms/network/UPNPHelper.java
View
9 src/main/java/net/pms/network/UPNPHelper.java
@@ -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();
Please sign in to comment.
Something went wrong with that request. Please try again.