Commit a6e7cd41 authored by SuperFashi's avatar SuperFashi

Ye

parent 127c2368
Pipeline #5724778 passed with stage
in 1 minute
......@@ -174,7 +174,9 @@ func Connector(proxy *Proxy, deadCnt int) {
log.Printf("%s无法连通!", proxy.host)
}
if isProxied {
go Connector(getNewProxy(), 0)
go func() {
Connector(getNewProxy(), 0)
}()
} else {
wg.Done()
}
......@@ -266,18 +268,20 @@ func Fmain() {
wg.Add(size * *multi)
if isProxied {
for i := 0; i < *multi; i++ {
go Connector(getNewProxy(), 0)
go func() {
Connector(getNewProxy(), 0)
}()
time.Sleep(100 * time.Microsecond)
}
} else if !isProxied {
} else {
for i := 0; i < *multi; i++ {
go Connector(nil, 0)
}
}
log.Println("连接完毕!")
wg.Wait()
log.Println("所有线程已死亡!退出……")
os.Exit(0)
log.Println("所有线程已死亡!")
exit()
}
func main() {
......@@ -291,10 +295,14 @@ func main() {
go Fmain()
case false:
log.Println("直播间已关闭!")
fmt.Println("最后祝您,____,再见。")
return
exit()
}
}
time.Sleep(time.Duration(RandInt(30, 60)) * time.Second)
}
}
func exit() {
log.Println("最后祝您,____,再见。")
os.Exit(0)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment