package ping
import "github.com/libp2p/go-libp2p/p2p/protocol/ping"
Index ¶
- Constants
- func Ping(ctx context.Context, h host.Host, p peer.ID) <-chan Result
- type PingService
- func NewPingService(h host.Host) *PingService
- func (ps *PingService) Ping(ctx context.Context, p peer.ID) <-chan Result
- func (p *PingService) PingHandler(s network.Stream)
- type Result
Constants ¶
const ( PingSize = 32 ID = "/ipfs/ping/1.0.0" ServiceName = "libp2p.ping" )
Functions ¶
func Ping ¶
Ping pings the remote peer until the context is canceled, returning a stream of RTTs or errors.
Types ¶
type PingService ¶
func NewPingService ¶
func NewPingService(h host.Host) *PingService
func (*PingService) Ping ¶
func (*PingService) PingHandler ¶
func (p *PingService) PingHandler(s network.Stream)
type Result ¶
Result is a result of a ping attempt, either an RTT or an error.
Source Files ¶
- Version
- v0.42.0 (latest)
- Published
- Jun 18, 2025
- Platform
- linux/amd64
- Imports
- 13 packages
- Last checked
- 1 month ago –
Tools for package owners.