ping

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2020 License: MIT Imports: 10 Imported by: 201

Documentation

Index

Constants

View Source
const ID = "/ipfs/ping/1.0.0"
View Source
const PingSize = 32

Variables

This section is empty.

Functions

func Ping

func Ping(ctx context.Context, h host.Host, p peer.ID) <-chan Result

Ping pings the remote peer until the context is canceled, returning a stream of RTTs or errors.

Types

type PingService

type PingService struct {
	Host host.Host
}

func NewPingService

func NewPingService(h host.Host) *PingService

func (*PingService) Ping

func (ps *PingService) Ping(ctx context.Context, p peer.ID) <-chan Result

func (*PingService) PingHandler

func (p *PingService) PingHandler(s network.Stream)

type Result added in v0.0.23

type Result struct {
	RTT   time.Duration
	Error error
}

Result is a result of a ping attempt, either an RTT or an error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL