|
|
|
|
@ -122,14 +122,16 @@ func Ping(domain string, PS int) {
|
|
|
|
|
向目标地址发送二进制报文包
|
|
|
|
|
如果发送失败就丢包 ++
|
|
|
|
|
*/
|
|
|
|
|
if _, err := conn.Write(buffer.Bytes()); err != nil {
|
|
|
|
|
index, err := conn.Write(buffer.Bytes())
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Printf("%s\n", red("timeout"))
|
|
|
|
|
dropPack++
|
|
|
|
|
time.Sleep(time.Second)
|
|
|
|
|
fmt.Println("666666666666666666666666666")
|
|
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
fmt.Println(index, "index")
|
|
|
|
|
|
|
|
|
|
// 否则记录当前得时间
|
|
|
|
|
t_start := time.Now()
|
|
|
|
|
conn.SetReadDeadline((time.Now().Add(time.Second * 3)))
|
|
|
|
|
|