From: Editor Lionbridge Date: Wed, 23 Aug 2017 05:37:43 +0000 (+0300) Subject: Add .NET NSD Guide X-Git-Tag: GitHub/PR#40/tizen-studio~47^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e787c63af400c20b3c73a48d6e3fa2f2282f586;p=sdk%2Fonline-doc.git Add .NET NSD Guide Note that since the general structure of the .NET content is still open, the new topic has not been added to any index files, and there is no parent topic introducing the .NET guides. Also, since there is no .NET AR content in git, all AR links lead directly to TD. PS2: Corrected the feature keys in the prerequisites section. Change-Id: Ie15a9d19951541f0cfa76026e35407cb544e01ee --- diff --git a/org.tizen.guides/html/dotnet/connectivity/nsd_cs.htm b/org.tizen.guides/html/dotnet/connectivity/nsd_cs.htm new file mode 100644 index 0000000..b1bb07c --- /dev/null +++ b/org.tizen.guides/html/dotnet/connectivity/nsd_cs.htm @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + Network Service Discovery + + + + +
+ +
+

Mobile C# TV C#

+
+ +
+

Dependencies

+
    +
  • Tizen 4.0 and Higher for Mobile and TV
  • +
+ +

Content

+ +

+ +

Related Info

+ +
+
+ +
+ +

Network Service Discovery

+

You can use 2 different protocols to perform network service discoveries to announce local services and search for remote services on a network: DNS-SD (DNS Service Discovery) and SSDP (Simple Service Discovery Protocol).

+

The main features of the Tizen.Network.Nsd namespace include:

+ + + +

Prerequisites

+

To enable your application to use the network service discovery functionality:

+
    +
  1. To use the Tizen.Network.Nds namespace, the application has to request permission by adding the following privilege to the tizen-manifest.xml file: +
    +<privileges>
    +   <privilege>http://tizen.org/privilege/internet</privilege>
    +</privileges>
    +
    +
  2. +
  3. To make your application visible in the Tizen Store only for devices that support the DNS-SD and SSDP protocols, the application must specify the following features in the tizen-manifest.xml file: +
    +<feature name="http://tizen.org/feature/network.service_discovery.dnssd"/>
    +<feature name="http://tizen.org/feature/network.service_discovery.ssdp"/>
    +
    +
  4. +
  5. To use the methods and properties of the Tizen.Network.Nsd namespace, include it in your application: +
    +using Tizen.Network.Nsd;
    +
    +
  6. +
+ +

Registering Local Services

+

To register and deregister a local DNS-SD service:

+
    +
  1. Register a service by creating a new instance of the Tizen.Network.Nsd.DnssdService class and using its RegisterService() method: +
    +/// Register service
    +INsdService service = new DnssdService("_http._tcp");
    +DnssdService dnssdService = (DnssdService)service;
    +dnssdService.RegisterService();
    +
    +
  2. +
  3. Deregister the service by using the DeregisterService() method. +

    When the Tizen.Network.Nsd.DnssdService class instance is no longer needed, destroy it with the Dispose() method.

    +
    +/// Deregister service
    +dnssdService.DeregisterService();
    +dnssdService.Dispose();
    +
    +
  4. +
+ +

Discovering Remote Services

+

To discover remote DNS-SD services:

+
    +
  1. Start discovery by creating a new instance of the Tizen.Network.Nsd.DnssdBrowser class and using its StartDiscovery() method: +
    +/// Start discovery
    +INsdBrowser browser = new DnssdBrowser("_http._tcp");
    +DnssdBrowser dnssdBrowser = (DnssdBrowser)browser;
    +dnssdBrowser.StartDiscovery();
    +
    +
  2. +
  3. When you have found the services you need, stop discovery by using the StopDiscovery() method. +

    When the Tizen.Network.Nsd.DnssdBrowser class instance is no longer needed, destroy it with the Dispose() method.

    +
    +/// Stop discovery
    +dnssdBrowser.StopDiscovery();
    +dnssdBrowser.Dispose();
    +
    +
  4. +
+ + + +
+ + +Go to top + + + + + + +