Registry / networking / tatsushid-go-fastping

tatsushid-go-fastping

JSON →
library0.0.0-20160109021039-d7bb493dee3egogounverified

Package fastping is an ICMP ping library inspired by AnyEvent::FastPing Perl module to send ICMP ECHO REQUEST packets quickly.

go get github.com/tatsushid/go-fastping
INSTALL
IMPORT
SIG · TATSUSHID-GO-FASTP
T
tatsushid-go-fastping
networkinggov0.0.0-20160109021039-d7bb493dee3e
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

fastping
github.com/tatsushid/go-fastping

Ping a host using ICMP

package main import ( "fmt" "github.com/tatsushid/go-fastping" "net" "time" ) func main() { p := fastping.NewPinger() ra, _ := net.ResolveIPAddr("ip4:icmp", "127.0.0.1") p.AddIPAddr(ra) p.OnRecv = func(addr *net.IPAddr, rtt time.Duration) { fmt.Printf("IP %s: %s\n", addr, rtt) } p.Run() }
Debug
Known issues
gotchaRequires root or CAP_NET_RAW on Linux for ICMP sockets
fix
Run with sudo or set capabilities: sudo setcap cap_net_raw+ep /path/to/binary
affects: all
Upgrade
Version history
0.0.0-20160109021039-d7bb493dee3elatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
tatsushid-go-fastping — go get tatsushid-go-fastping · libregistry