Skip to content

Commit

Permalink
fix: Error printing method called
Browse files Browse the repository at this point in the history
  • Loading branch information
sjlleo committed Jan 13, 2023
1 parent 2d95fed commit 7ee7659
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 6 additions & 3 deletions trace/tcp_ipv4.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@ func (t *TCPTracer) Execute() (*Result, error) {
time.Sleep(1 * time.Millisecond)
}
go func() {
for {
t.AsyncPrinter(&t.res)
time.Sleep(50 * time.Millisecond)
if t.AsyncPrinter != nil {
for {
t.AsyncPrinter(&t.res)
time.Sleep(50 * time.Millisecond)
}
}

}()

// 如果是表格模式,则一次性并发请求
Expand Down
8 changes: 5 additions & 3 deletions trace/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ func (t *UDPTracer) Execute() (*Result, error) {
time.Sleep(1 * time.Millisecond)
}
go func() {
for {
t.AsyncPrinter(&t.res)
time.Sleep(50 * time.Millisecond)
if t.AsyncPrinter != nil {
for {
t.AsyncPrinter(&t.res)
time.Sleep(50 * time.Millisecond)
}
}
}()
// 如果是表格模式,则一次性并发请求
Expand Down

0 comments on commit 7ee7659

Please sign in to comment.