Show / Hide Table of Contents

Class Ping1

Ping Protocol version 1.0

Inheritance
Object
Ping1
Implements
IPeerProtocol
IService
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Namespace: PeerTalk.Protocols
Assembly: PeerTalk.dll
Syntax
public class Ping1 : IPeerProtocol, IService

Properties

| Improve this Doc View Source

Name

The name of the protocol.

Declaration
public string Name { get; }
Property Value
Type Description
String
| Improve this Doc View Source

Swarm

Provides access to other peers.

Declaration
public Swarm Swarm { get; set; }
Property Value
Type Description
Swarm
| 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

PingAsync(MultiAddress, Int32, CancellationToken)

Send echo requests to a peer.

Declaration
public Task<IEnumerable<PingResult>> PingAsync(MultiAddress address, int count = 10, CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
MultiAddress address

The address of a peer to receive the echo requests.

Int32 count

The number of echo requests to send. Defaults to 10.

CancellationToken cancel

Is used to stop the task. When cancelled, the TaskCanceledException is raised.

Returns
Type Description
Task<IEnumerable<PingResult>>

A task that represents the asynchronous operation. The task's value is the sequence of PingResult.

| Improve this Doc View Source

PingAsync(MultiHash, Int32, CancellationToken)

Send echo requests to a peer.

Declaration
public Task<IEnumerable<PingResult>> PingAsync(MultiHash peerId, int count = 10, CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
MultiHash peerId

The peer ID to receive the echo requests.

Int32 count

The number of echo requests to send. Defaults to 10.

CancellationToken cancel

Is used to stop the task. When cancelled, the TaskCanceledException is raised.

Returns
Type Description
Task<IEnumerable<PingResult>>

A task that represents the asynchronous operation. The task's value is the sequence of PingResult.

| 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
Type Name Description
PeerConnection connection

A connection between two peers.

Stream stream

The message source.

CancellationToken cancel

Is used to stop the task. When cancelled, the TaskCanceledException is raised.

Returns
Type Description
Task

A task that represents the asynchronous operation.

| 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
| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
String
Overrides
Object.ToString()

Implements

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