Registry / networking / erikh-ping

erikh-ping

JSON →
library0.0.0-20141209185752-d731d249e12agogounverified

Provides a simple ICMP ping implementation for Go.

go get github.com/erikh/ping
INSTALL
IMPORT
SIG · ERIKH-PING
E
erikh-ping
networkinggov0.0.0-20141209185752-d731d249e12a
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.

ping
github.com/erikh/ping

Shows how to create a pinger, set count, run, and get statistics.

package main import ( "fmt" "github.com/erikh/ping" ) func main() { // Example: ping a host pinger, err := ping.NewPinger("google.com") if err != nil { panic(err) } pinger.Count = 3 err = pinger.Run() if err != nil { panic(err) } stats := pinger.Statistics() fmt.Printf("Sent: %d, Received: %d\n", stats.PacketsSent, stats.PacketsRecv) }
Debug
Known issues
gotchaRequires root or CAP_NET_RAW on Linux to create raw sockets.
fix
Run the program with sudo or set capabilities: sudo setcap cap_net_raw+ep /path/to/binary
affects: all
Upgrade
Version history
0.0.0-20141209185752-d731d249e12alatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
erikh-ping — go get erikh-ping · libregistry