UPnP and stale devices RRS feed

  • Question

  • Using the control point API from windows UPNPLib, and also by observation through My Network Places, if a device sends a NOTIFY with "NTS: ssdp:alive" the device appears at the control point API and in My Network Places.  If that device sends a NOTIFY with "NTS: ssdp:byebye" the control point API is notified and the device disappears from My Network Places and the UPnP device cache.

    However, if the NOTIFY with "NTS: ssdp:byebye" does not get to the windows UPnP stack, or if the device doesn't send one (power outage, network outage, not implemented, etc.) the device is not removed from the cache, it stays in My Network Places and additional calls from the control point API show the device.  I assume that the device would disappear after the cache timeout for the device expires but since this time is generally 30 minutes or greater it could be a very long time before the device is removed.

    An additional unfortunate side affect is that when the device comes back the async finder interface of the control point API does not get called back when the device reappears.

    The implications are that when a device disappears from the network, my control point code tries to reach the device and times out because it is not there.  If I cache the device as not really there I can avoid additional attempts to connect but at a cost of not being able to see it if the device reappears.

    I did notice that if I try to invoke the device from My Network Places that a missing device will sometimes be removed from the display prior to the cache timeout but when I make the device reappear the async control point does not get called back even though the device then reappears in My Network Places.

    I have not found any interfaces in UPNPLib to clear the cache and the UPNPHostLib interfaces appear to only operate on devices created on that host so the registrar interface does not work. 

    Is there some way to get the async control point IUPnPDeviceFinder interface to receive a callback when a device goes away and then comes back?  Perhaps some registry settings?


    Tuesday, February 15, 2011 7:08 PM


All replies