File tree Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -127,15 +127,15 @@ func (s *ArpScanner) Scan() error {
127
127
})
128
128
}
129
129
130
- time .Sleep (s .idleTimeout )
130
+ time .AfterFunc (s .idleTimeout , func () {
131
+ go s .Stop ()
131
132
132
- go s .Stop ()
133
-
134
- go func () {
135
- s .resultChan <- & ScanResult {
136
- Type : ARPDone ,
137
- }
138
- }()
133
+ go func () {
134
+ s .resultChan <- & ScanResult {
135
+ Type : ARPDone ,
136
+ }
137
+ }()
138
+ })
139
139
140
140
return err
141
141
}
Original file line number Diff line number Diff line change @@ -156,15 +156,15 @@ func (s *SynScanner) Scan() error {
156
156
}
157
157
}
158
158
159
- time .Sleep (s .idleTimeout )
159
+ time .AfterFunc (s .idleTimeout , func () {
160
+ go s .Stop ()
160
161
161
- go s .Stop ()
162
-
163
- go func () {
164
- s .resultChan <- & ScanResult {
165
- Type : SYNDone ,
166
- }
167
- }()
162
+ go func () {
163
+ s .resultChan <- & ScanResult {
164
+ Type : SYNDone ,
165
+ }
166
+ }()
167
+ })
168
168
169
169
return nil
170
170
}
You can’t perform that action at this time.
0 commit comments