Searching non-stop new/old devices?

Feb 8, 2013 at 1:39 PM

I'm currently trying to use your library to detect different part of our software on different server(composed of servers and clients).

For the server side, I'm currently using "OhNet", which seems to works fine.

I created the simpliest client using your library(Just creating a Discovery with my searchUri + a Console.Writeline for each event I receive).
I noticed the following: If I've my device up & running when I launch the search, I've no problem, event are called to display the new object
But if I start the search, then wait that the SearchComplete has been called at least once, and then I start my Device Host, I don't receive any "added" event.

I also never received a Removed Event for my device(even I added & removed it several times).

I assume that the host is working right, because the Intel Device Spy show me just exactly what is happening, everytime in less than one second(adding/removing).

So, should I do something special to have an initial search, then a continous added/removed event?
Feb 9, 2013 at 3:57 AM
Hi Narzgul,

Which version of windows is the Client running on? I only ask because in certain versions of windows the continuous device detection is a bit flaky with the Microsoft UPnP API, providing you leave the search running, it is "meant" to continually detect and remove devices as they come, and it has worked for me whenever I have tried it.

Do you have any other information which might shed some light on why it dosn't work?

Feb 9, 2013 at 7:10 AM

Thank you for the response.

I've a windows 7 64 bits. I've two network adapters, and they have a different sub network, but I suppose it should'nt be a problem.

I'm running the client and the server on the same computer.

What can I do/test for more informations?

Feb 9, 2013 at 10:11 AM

It could possibly be the multiple NICs causing the issue, maybe the Server is sending to a different NIC that the client is listening on?

Maybe try wtih just one NIC, just disable the other one.

Feb 9, 2013 at 10:44 AM
I don't think so because the server is on the same computer than the client, and I didn't specified any NIC.

I will try this monday(don't have access to this network until then), but for us, it's needed to be able to listen on all networks.
Feb 9, 2013 at 12:00 PM
It definitely should not be a problem (it should listen on all adapters), but give it a go and let me know :) Cheers.
Feb 11, 2013 at 8:35 AM
Edited Feb 11, 2013 at 9:02 AM
I tested, it doesn't seems to change anything.

I create a test solution:

You can find the "DeviceHoster" project, which host a device(with OhNet).
And you have the "ControlPointApplication" that use ManagedUpnp.

To reproduce my problem:
  1. Start ControlPointApplication
  2. Wait until you got the "Search completed" message in the console
  3. Start the DeviceHoster console
Current situation:
After getting the "search completed" message, I don't see any new device(or removed device)

Wanted situation:
After finishing the initial search, I want to see devices which are registering.

Second problem
  1. Start DeviceHoster
  2. Start ControlPointApplication
  3. Wait to see the "search completed" message
  4. Stop the DeviceHoster
Current situation
The device has been registered correctly, but the control point doesn't give me any Device removed

Wanted situation
  • That when a device send a BYEBYE message, I receive a device disconnected
  • That when a device disconnect without a BYEBYE(power drop, ...) we can refresh its state(e.g. every 10-15min)
Can you reproduce my problems?

DeviceSpy reacts instantly to my two problems. Is there some kind of format/message of OhNet that ManagedUpnp doesn't handle well?

EDIT: in fact after 10-15min, I got the removed event
Feb 11, 2013 at 10:41 AM

When I get some spare time I will test this for you, however, this is all handled internally by the Windows UPnP API, ManagedUPnP dosnt handle it itself, but I will test and let you know, thanks for putting in the effort to allow me to test :)