Class ContentRouter
Manages a list of content that is provided by multiple peers.
Implements
Inherited Members
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 SourceProviderTTL
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 SourceAdd(Cid, MultiHash)
Declaration
public void Add(Cid cid, MultiHash provider)
Parameters
| Type | Name | Description |
|---|---|---|
| Cid | cid | The ID of some content that the |
| MultiHash | provider | The peer ID that contains the |
Add(Cid, MultiHash, DateTime)
Declaration
public void Add(Cid cid, MultiHash provider, DateTime now)
Parameters
| Type | Name | Description |
|---|---|---|
| Cid | cid | The ID of some content that the |
| MultiHash | provider | The peer ID that contains the |
| DateTime | now | The local time that the |
Dispose()
Declaration
public void Dispose()
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 |