Show / Hide Table of Contents

Class ContentRouter

Manages a list of content that is provided by multiple peers.

Inheritance
Object
ContentRouter
Implements
IDisposable
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: PeerTalk.Routing
Assembly: PeerTalk.dll
Syntax
public class ContentRouter : IDisposable
Remarks

A peer is expected to provide content for at least ProviderTTL. After this expires the provider is removed from the list.

Properties

| Improve this Doc View Source

ProviderTTL

How long a provider is assumed to provide some content.

Declaration
public TimeSpan ProviderTTL { get; set; }
Property Value
Type Description
TimeSpan

Defaults to 24 hours (1 day).

Methods

| Improve this Doc View Source

Add(Cid, MultiHash)

Adds the Cid and Peer to the content routing system.

Declaration
public void Add(Cid cid, MultiHash provider)
Parameters
Type Name Description
Cid cid

The ID of some content that the provider contains.

MultiHash provider

The peer ID that contains the cid.

| Improve this Doc View Source

Add(Cid, MultiHash, DateTime)

Adds the Cid and Peer to the content routing system at the specified DateTime.

Declaration
public void Add(Cid cid, MultiHash provider, DateTime now)
Parameters
Type Name Description
Cid cid

The ID of some content that the provider contains.

MultiHash provider

The peer ID that contains the cid.

DateTime now

The local time that the provider started to provide the cid.

| Improve this Doc View Source

Dispose()

Declaration
public void Dispose()
| Improve this Doc View Source

Get(Cid)

Gets the providers for the Cid.

Declaration
public IEnumerable<MultiHash> Get(Cid cid)
Parameters
Type Name Description
Cid cid

The ID of some content.

Returns
Type Description
IEnumerable<MultiHash>

A sequence of peer IDs (providers) that contain the cid.

Implements

System.IDisposable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX