Class Dht1
Assembly: PeerTalk.dll
Syntax
public class Dht1 : IPeerProtocol, IService, IPeerRouting, IContentRouting
Fields
|
Improve this Doc
View Source
ContentRouter
Peers that can provide some content.
Declaration
public ContentRouter ContentRouter
Field Value
|
Improve this Doc
View Source
RoutingTable
Routing information on peers.
Declaration
public RoutingTable RoutingTable
Field Value
Properties
|
Improve this Doc
View Source
CloserPeerCount
The number of closer peers to return.
Declaration
public int CloserPeerCount { get; set; }
Property Value
Type |
Description |
Int32 |
Defaults to 20.
|
|
Improve this Doc
View Source
Name
The name of the protocol.
Declaration
public string Name { get; }
Property Value
|
Improve this Doc
View Source
Swarm
Provides access to other peers.
Declaration
public Swarm Swarm { get; set; }
Property Value
|
Improve this Doc
View Source
Version
The version of the protocol.
Declaration
public SemVersion Version { get; }
Property Value
Type |
Description |
Semver.SemVersion |
|
Methods
|
Improve this Doc
View Source
Advertise(Cid)
Advertise that we can provide the CID to the X closest peers
of the CID.
Declaration
public void Advertise(Cid cid)
Parameters
Type |
Name |
Description |
Cid |
cid |
The CID to advertise.
|
|
Improve this Doc
View Source
FindPeerAsync(MultiHash, CancellationToken)
Declaration
public Task<Peer> FindPeerAsync(MultiHash id, CancellationToken cancel = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
FindProvidersAsync(Cid, Int32, Action<Peer>, CancellationToken)
Declaration
public Task<IEnumerable<Peer>> FindProvidersAsync(Cid id, int limit = 20, Action<Peer> action = null, CancellationToken cancel = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
ProcessAddProvider(Peer, DhtMessage, DhtMessage)
Process an add provider request.
Declaration
public DhtMessage ProcessAddProvider(Peer remotePeer, DhtMessage request, DhtMessage response)
Parameters
Returns
|
Improve this Doc
View Source
ProcessFindNode(DhtMessage, DhtMessage)
Process a find node request.
Declaration
public DhtMessage ProcessFindNode(DhtMessage request, DhtMessage response)
Parameters
Returns
|
Improve this Doc
View Source
ProcessGetProviders(DhtMessage, DhtMessage)
Process a get provider request.
Declaration
public DhtMessage ProcessGetProviders(DhtMessage request, DhtMessage response)
Parameters
Returns
|
Improve this Doc
View Source
ProcessMessageAsync(PeerConnection, Stream, CancellationToken)
Process a message for the protocol.
Declaration
public Task ProcessMessageAsync(PeerConnection connection, Stream stream, CancellationToken cancel = default(CancellationToken))
Parameters
Returns
Type |
Description |
Task |
A task that represents the asynchronous operation.
|
|
Improve this Doc
View Source
ProvideAsync(Cid, Boolean, CancellationToken)
Declaration
public Task ProvideAsync(Cid cid, bool advertise = true, CancellationToken cancel = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
StartAsync()
Declaration
Returns
|
Improve this Doc
View Source
StopAsync()
Declaration
Returns
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
Events
|
Improve this Doc
View Source
Stopped
Raised when the DHT is stopped.
Declaration
public event EventHandler Stopped
Event Type
See Also
Implements