1 Star 0 Fork 0

gunsluo / sw

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ping.go 408 Bytes
一键复制 编辑 原始数据 按行查看 历史
gunsluo 提交于 2016-08-15 13:19 . init
package sw
func PingRtt(ip string, timeout int, fastPingMode bool) (float64, error) {
var rtt float64
var err error
if fastPingMode == true {
rtt, err = fastPingRtt(ip, timeout)
} else {
rtt, err = goPingRtt(ip, timeout)
}
return rtt, err
}
func Ping(ip string, timeout int, fastPingMode bool) bool {
rtt, _ := PingRtt(ip, timeout, fastPingMode)
if rtt == -1 {
return false
}
return true
}
Go
1
https://gitee.com/gunsluo/sw.git
git@gitee.com:gunsluo/sw.git
gunsluo
sw
sw
dev

搜索帮助