- 创建 Pinger 实例需要提供网络接口的名称: 固定使用该网络接口第一个 IPv4 地址, 优先使用该网络接口第一个掩码为 128 的 IPv6 地址
- 发送 ICMP 包: 使用 FlagInterface 与 ControlMessage, 确保出包经过 Pinger 实例的网络接口
- 接收 ICMP 包: 仅监听 Pinger 实例的网络接口地址, 避免多网络接口环境下回包混乱
A simple ICMP Echo implementation, based on golang.org/x/net/icmp.
- IPv4 and IPv6 support
- Unicast and multicast support
- configurable retry amount and timeout duration
- configurable payload size (and content)
- round trip time measurement
Simply fork and create a pull-request. We'll try to respond in a timely fashion.
MIT License, Copyright (c) 2018 Digineo GmbH