-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
531ac28
commit 047e848
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Advertising | ||
|
||
[ServiceDiscovery.Advertise](xref:Makaretu.Dns.ServiceDiscovery.Advertise*) | ||
is used to generate all the DNS [resource records](xref:Makaretu.Dns.ResourceRecord) needed to | ||
answer a Multicast DNS or DNS-SD query for a [service profile](xref:Makaretu.Dns.ServiceProfile). | ||
|
||
### Usage | ||
```csharp | ||
var profile = new ServiceProfile("me", "_myservice._udp", 1234, | ||
new IPAddress[] { IPAddress.Loopback }); | ||
profile.Subtypes.Add("apiv2"); | ||
profile.AddProperty("someprop", "somevalue"); | ||
|
||
var sd = new ServiceDiscovery(); | ||
sd.Advertise(profile); | ||
``` | ||
|
||
### Resource records | ||
|
||
The following resource records are generated from the above profile. | ||
|
||
``` | ||
_services._dns-sd._udp.local PTR _myservice._udp.local | ||
_myservice._udp.local PTR me._myservice._udp.local | ||
apiv2._sub._myservice._udp.local PTR me._myservice._udp.local | ||
me._myservice._udp.local SRV 0 0 1234 me.myservice.local | ||
me._myservice._udp.local TXT txtvers=1 someprop=somevalue | ||
me.myservice.local A 127.0.0.1 | ||
1.0.0.127.in-addr.arpa PTR me.myservice.local | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters