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")) fmt.Printf("%s\n", red("timeout"))
dropPack++ dropPack++
time.Sleep(time.Second) time.Sleep(time.Second)
fmt.Println("666666666666666666666666666") 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)))

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