debug for index len err

master
dustoair 3 years ago
parent acbbcc99d3
commit 105ebd8927

@ -124,18 +124,18 @@ func Ping(domain string, PS int) {
*/ */
index, err := conn.Write(buffer.Bytes()) index, err := conn.Write(buffer.Bytes())
if err != nil { if err != nil {
fmt.Printf("%s\n", red("timeout")) //这种判断其实不必要 发包一定可以 error返回一定是nil
fmt.Printf("%s\n", red("timeout", index))
dropPack++ dropPack++
time.Sleep(time.Second) time.Sleep(time.Second)
fmt.Println("666666666666666666666666666")
continue continue
} }
fmt.Println(index, "index")
// 否则记录当前得时间 // 否则记录当前得时间
t_start := time.Now() t_start := time.Now()
conn.SetReadDeadline((time.Now().Add(time.Second * 3))) conn.SetReadDeadline((time.Now().Add(time.Second * 3)))
len, err := conn.Read(recv) len, err := conn.Read(recv)
fmt.Println(len, err)
/* /*
++ ++

Loading…
Cancel
Save