|
|
|
|
@ -112,6 +112,7 @@ func Ping(domain string, PS int) {
|
|
|
|
|
icmp_seq := 1
|
|
|
|
|
|
|
|
|
|
c := make(chan os.Signal, 1)
|
|
|
|
|
signal.Notify(c, os.Interrupt, os.Kill)
|
|
|
|
|
for {
|
|
|
|
|
/*
|
|
|
|
|
向目标地址发送二进制报文包
|
|
|
|
|
@ -147,11 +148,9 @@ func Ping(domain string, PS int) {
|
|
|
|
|
|
|
|
|
|
select {
|
|
|
|
|
case s := <-c:
|
|
|
|
|
fmt.Println("777777777777777777777777")
|
|
|
|
|
signal.Notify(c, os.Interrupt, os.Kill)
|
|
|
|
|
fmt.Println("Got signal:", s)
|
|
|
|
|
foot(raddr.String(), icmp_seq, dropPack, min_lan, avg_lan, max_lan, ret_list)
|
|
|
|
|
os.Exit(0)
|
|
|
|
|
fmt.Println("Got signal:", s)
|
|
|
|
|
default:
|
|
|
|
|
fmt.Printf("%d bytes from %s (%s): icmp_seq=%d ttl=53 time=%.3f ms\n", len, raddr.String(), raddr.String(), icmp_seq, dur)
|
|
|
|
|
//fmt.Printf("来自 %s 的回复: 大小 = %d byte 时间 = %.3fms\n", raddr.String(), len, dur)
|
|
|
|
|
|