Class PeerManager
Manages the peers.
Implements
Inherited Members
Namespace: PeerTalk
Assembly: PeerTalk.dll
Syntax
public class PeerManager : IService
Remarks
Listens to the Swarm events to determine the state of a peer.
Fields
| Improve this Doc View SourceDeadPeers
The peers that are reachable.
Declaration
public ConcurrentDictionary<Peer, DeadPeer> DeadPeers
Field Value
Type | Description |
---|---|
ConcurrentDictionary<Peer, DeadPeer> |
InitialBackoff
Initial time to wait before attempting a reconnection to a dead peer.
Declaration
public TimeSpan InitialBackoff
Field Value
Type | Description |
---|---|
TimeSpan | Defaults to 1 minute. |
MaxBackoff
When reached, the peer is considered permanently dead.
Declaration
public TimeSpan MaxBackoff
Field Value
Type | Description |
---|---|
TimeSpan | Defaults to 64 minutes. |
Properties
| Improve this Doc View SourceSwarm
Provides access to other peers.
Declaration
public Swarm Swarm { get; set; }
Property Value
Type | Description |
---|---|
Swarm |
Methods
| Improve this Doc View SourceSetNotReachable(Peer)
Indicates that the peer can not be connected to.
Declaration
public void SetNotReachable(Peer peer)
Parameters
Type | Name | Description |
---|---|---|
Peer | peer |
SetReachable(Peer)
Indicates that the peer can be connected to.
Declaration
public void SetReachable(Peer peer)
Parameters
Type | Name | Description |
---|---|---|
Peer | peer |
StartAsync()
Start the service.
Declaration
public Task StartAsync()
Returns
Type | Description |
---|---|
Task |
StopAsync()
Stop the service.
Declaration
public Task StopAsync()
Returns
Type | Description |
---|---|
Task |