|
|
|
|
@ -22,11 +22,12 @@ pong www.baidu.com 443 -t 1 -k udp
|
|
|
|
|
pong -a www.baidu.com -p 443 -k tcp -t 3
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
func main2() {
|
|
|
|
|
func main() {
|
|
|
|
|
c := make(chan os.Signal, 1)
|
|
|
|
|
for {
|
|
|
|
|
select {
|
|
|
|
|
case s := <-c:
|
|
|
|
|
fmt.Println("ctc")
|
|
|
|
|
signal.Notify(c, os.Interrupt, os.Kill)
|
|
|
|
|
fmt.Println("Got signal:", s)
|
|
|
|
|
os.Exit(0)
|
|
|
|
|
@ -37,7 +38,7 @@ func main2() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
func main3() {
|
|
|
|
|
address := flag.String("a", "", "domain or ip address")
|
|
|
|
|
port := flag.Int("p", 0, "port")
|
|
|
|
|
protocol := flag.String("k", "tcp", "protocol kind")
|
|
|
|
|
|