go-libp2p: github.com/libp2p/go-libp2p/p2p/protocol/ping Index | Files

package ping

import "github.com/libp2p/go-libp2p/p2p/protocol/ping"

Index

Package Files

ping.go

Constants

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

func Ping Uses

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.

type PingService Uses

type PingService struct {
    Host host.Host
}

func NewPingService Uses

func NewPingService(h host.Host) *PingService

func (*PingService) Ping Uses

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

func (*PingService) PingHandler Uses

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

type Result Uses

type Result struct {
    RTT   time.Duration
    Error error
}

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

Package ping imports 10 packages (graph) and is imported by 31 packages. Updated 2019-05-27. Refresh now. Tools for package owners.