Skip to content

Commit

Permalink
超时单位改为毫秒
Browse files Browse the repository at this point in the history
  • Loading branch information
shmilylty committed Feb 10, 2022
1 parent b02082b commit d2946ad
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/arp/arp.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ func Spy(c *cli.Context) {
Log.Info("use arp protocol to spy")
checkOs()
iface = c.String("interface")
timeout = time.Duration(c.Int("timeout")) * time.Second
timeout = time.Duration(c.Int("timeout")) * time.Millisecond
spy.Spy(c, check)
}
4 changes: 2 additions & 2 deletions core/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func Execute() {
&cli.IntFlag{
Name: "timeout",
Aliases: []string{"m"},
Usage: "packet sending timeout",
Value: 1,
Usage: "packet sending timeout millisecond",
Value: 100,
},
&cli.PathFlag{
Name: "output",
Expand Down
2 changes: 1 addition & 1 deletion core/icmp/icmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ func Spy(c *cli.Context) {
Log.Info("use icmp protocol to spy")
checkPermission()
times = c.Int("times")
timeout = time.Duration(c.Int("timeout")) * time.Second
timeout = time.Duration(c.Int("timeout")) * time.Millisecond
spy.Spy(c, check)
}
2 changes: 1 addition & 1 deletion core/tcp/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func check(ip string) bool {

func Spy(c *cli.Context) {
Log.Info("use tcp protocol to spy")
timeout = time.Duration(c.Int("timeout")) * time.Second
timeout = time.Duration(c.Int("timeout")) * time.Millisecond
ports = c.IntSlice("port")
spy.Spy(c, check)
}
2 changes: 1 addition & 1 deletion core/udp/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func check(ip string) bool {

func Spy(c *cli.Context) {
Log.Info("use udp protocol to spy")
timeout = time.Duration(c.Int("timeout")) * time.Second
timeout = time.Duration(c.Int("timeout")) * time.Millisecond
ports = c.IntSlice("port")
spy.Spy(c, check)
}
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ GLOBAL OPTIONS:
--random value, -r value IP随机末尾数字的个数(默认: 3)
--force value, -f value 强制探测所有生成的IP(默认: false)
--thread value, -t value 并发数量(默认: cpu * 20)
--timeout value, -m value 发包超时(默认: 1秒)
--timeout value, -m value 发包超时毫秒(默认: 100)
--output value, -o value 存活网段结果保存路径(默认: "alive.txt")
--auto, -a 是否进行自动探测(默认: true)
--silent, -s 只显示存活网段(默认: false)
Expand Down

0 comments on commit d2946ad

Please sign in to comment.