3

I have found many suggestions about how to use UPnP to discover existing devices and even send control commands to them.

Is there a UPnP Library for .NET (C# or VB.NET)?

In my case, I have to create a service that can be discovered as a UPnP device (it should broadcast its ID and its IP address). The discovering client is an Android phone. Basically my service should use the Device Host API.

Can you suggest any library that makes this easy?

Community
  • 1
  • 1
Nestor
  • 8,194
  • 7
  • 77
  • 156
  • Many of the libraries suggested in the question you link to include device stacks. If you've tried some/all of them, can you update your question to explain how they were deficient? – simonc Jan 06 '14 at 14:35

2 Answers2

2

Try this one out :

OhNet - http://wiki.openhome.org/wiki/OhNet

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Curtis
  • 5,794
  • 8
  • 50
  • 77
  • OhNet seems like a good starting point. Unfortunately I already accomplished the job with good old basic socket programming. That is known for each party involved in the communication :) – Nestor Jul 24 '14 at 09:06
2

You should use WCF Discovery.

The basic protocol that under pins it is WS-Discovery

Aron
  • 15,464
  • 3
  • 31
  • 64
  • I guess, it can't easily be discovered by an Android client. – Nestor Jul 24 '14 at 09:03
  • 1
    http://stackoverflow.com/questions/1946206/ws-discovery-implementations-for-java – Aron Jul 24 '14 at 09:05
  • Thanks, I keep it in my mind. The job is already done but next time I'll give this a try. – Nestor Jul 24 '14 at 09:08
  • You can still advertise the service using WS-Discovery. Although its a bit weird that you decided to use raw sockets. Also I would still very much recommend that you switch to using SOAP instead of a custom socket solution, as you are going to have lots of pain when you version your pure socket solution. – Aron Jul 24 '14 at 09:13
  • More so given that you are going to be cross platforming. – Aron Jul 24 '14 at 09:24
  • Can you elaborate on why my socket solution should become useless? I created it months ago and it still rocks and .Net and Android happily communicate. – Nestor Jul 24 '14 at 09:59
  • @Nestor 1. iPhone version ? 2. When you add a new field to your data package. 3. Firewalls – Aron Jul 24 '14 at 10:02
  • Thanks, your concerns are noted. I'll consider changing the protocol. – Nestor Jul 24 '14 at 12:41