Show / Hide Table of Contents

Class Mdns

Base class to discover peers using Multicast DNS.

Inheritance
Object
Mdns
MdnsJs
MdnsNext
Implements
IPeerDiscovery
IService
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: PeerTalk.Discovery
Assembly: PeerTalk.dll
Syntax
public abstract class Mdns : IPeerDiscovery, IService

Properties

| Improve this Doc View Source

Broadcast

Determines if the local peer responds to a query.

Declaration
public bool Broadcast { get; set; }
Property Value
Type Description
Boolean

true to answer queries. Defaults to true.

| Improve this Doc View Source

LocalPeer

The local peer.

Declaration
public Peer LocalPeer { get; set; }
Property Value
Type Description
Peer
| Improve this Doc View Source

MulticastService

The Muticast Domain Name Service to use.

Declaration
public MulticastService MulticastService { get; set; }
Property Value
Type Description
MulticastService
| Improve this Doc View Source

ServiceName

The service name for our peers.

Declaration
public string ServiceName { get; set; }
Property Value
Type Description
String

Defaults to "ipfs".

Methods

| Improve this Doc View Source

BuildProfile()

Build the profile which contains the DNS records that are needed to locate and connect to the local peer.

Declaration
public abstract ServiceProfile BuildProfile()
Returns
Type Description
ServiceProfile

Describes the service.

| Improve this Doc View Source

GetAddresses(Message)

Get the addresses of the peer in the DNS message.

Declaration
public abstract IEnumerable<MultiAddress> GetAddresses(Message message)
Parameters
Type Name Description
Makaretu.Dns.Message message

An answer describing a peer.

Returns
Type Description
IEnumerable<MultiAddress>

All the addresses of the peer.

| Improve this Doc View Source

OnServiceDiscovery(ServiceDiscovery)

Allows derived class to modify the service discovery behavior.

Declaration
protected virtual void OnServiceDiscovery(ServiceDiscovery discovery)
Parameters
Type Name Description
ServiceDiscovery discovery
| Improve this Doc View Source

StartAsync()

Start the service.

Declaration
public Task StartAsync()
Returns
Type Description
Task
| Improve this Doc View Source

StopAsync()

Stop the service.

Declaration
public Task StopAsync()
Returns
Type Description
Task

Events

| Improve this Doc View Source

PeerDiscovered

Raised when a peer is discovered.

Declaration
public event EventHandler<Peer> PeerDiscovered
Event Type
Type Description
EventHandler<Peer>
Remarks

The peer must contain at least one MultiAddress. The address must end with the ipfs protocol and the public ID of the peer. For example "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"

Implements

IPeerDiscovery
IService
  • Improve this Doc
  • View Source
Back to top Generated by DocFX