UPnP: Fix bug causing failure when the PC has multiple interfaces

This commit is contained in:
zzz
2011-08-16 16:20:51 +00:00
parent dc02f9cd88
commit f7c31950b3
9 changed files with 91 additions and 6 deletions

View File

@@ -230,6 +230,7 @@ public class ControlPoint implements HTTPRequestListener
if (rootDev == null)
return;
rootDev.setSSDPPacket(ssdpPacket);
Debug.warning("Add root device", new Exception("received on " + ssdpPacket.getLocalAddress()));
addDevice(rootNode);
// Thanks for Oliver Newell (2004/10/16)

View File

@@ -191,6 +191,7 @@ public class HTTPMUSocket
try {
ssdpMultiSock.receive(recvPacket.getDatagramPacket());
recvPacket.setTimeStamp(System.currentTimeMillis());
Debug.warning("Received SSDP multicast packet on " + getLocalAddress() + " from " + recvPacket.getRemoteAddress());
}
catch (Exception e) {
//Debug.warning(e);

View File

@@ -195,6 +195,7 @@ public class HTTPUSocket
try {
ssdpUniSock.receive(recvPacket.getDatagramPacket());
recvPacket.setTimeStamp(System.currentTimeMillis());
Debug.warning("Received SSDP unicast packet on " + getLocalAddress() + " from " + recvPacket.getRemoteAddress());
}
catch (Exception e) {
//Debug.warning(e);

View File

@@ -29,6 +29,7 @@ import java.net.*;
import org.cybergarage.net.*;
import org.cybergarage.http.*;
import org.cybergarage.upnp.*;
import org.cybergarage.util.Debug;
public class SSDPNotifySocket extends HTTPMUSocket implements Runnable
{
@@ -47,6 +48,7 @@ public class SSDPNotifySocket extends HTTPMUSocket implements Runnable
useIPv6Address = true;
}
open(addr, SSDP.PORT, bindAddr);
Debug.warning("Opened SSDP notify socket at " + bindAddr + ':' + SSDP.PORT);
setControlPoint(null);
}

View File

@@ -3,7 +3,7 @@
* CyberUPnP for Java
*
* Copyright (C) Satoshi Konno 2002-2003
*
*
* File: SSDPSearchResponseSocketList.java
*
* Revision;
@@ -14,7 +14,7 @@
* - Added post() to send a SSDPSearchRequest.
*
******************************************************************/
package org.cybergarage.upnp.ssdp;
import java.util.*;
@@ -22,6 +22,7 @@ import java.util.*;
import org.cybergarage.net.*;
import org.cybergarage.upnp.*;
import org.cybergarage.util.Debug;
public class SSDPSearchResponseSocketList extends Vector
{
@@ -68,6 +69,7 @@ public class SSDPSearchResponseSocketList extends Vector
for (int n=0; n<nHostAddrs; n++) {
String bindAddr = HostInterface.getHostAddress(n);
SSDPSearchResponseSocket socket = new SSDPSearchResponseSocket(bindAddr, port);
Debug.warning("Opened SSDP search response socket at " + bindAddr + ':' + port);
add(socket);
}
}

View File

@@ -37,6 +37,7 @@ public class SSDPSearchSocket extends HTTPMUSocket implements Runnable
public SSDPSearchSocket(String bindAddr)
{
open(bindAddr);
Debug.warning("Opened SSDP search socket at " + bindAddr + ':' + SSDP.PORT);
}
////////////////////////////////////////////////