debug for index

master
dustoair 3 years ago
parent abe7821eff
commit acbbcc99d3

@ -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)))

@ -28,9 +28,10 @@ cd /root
rm -rf pong
git clone https://git.sre.ink/go/pong.git
cd pong
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on GOPROXY="https://goproxy.cn,direct" go mod tidy
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on GOPROXY="https://goproxy.cn,direct" go build -v -a -o pong pong.go
make build-linux-amd64
rm -rf /usr/bin/pong
mv pong /usr/bin/
pong www.baidu.com 443
```
# issue
pong www.baidu1.com 不会捕获ctrlc
Loading…
Cancel
Save