Commit 3e9337f
Fix busy-loop in I2P Accept when socket has error
The Wait() function returns false for both timeout and socket errors.
Previously, the Accept loop treated all false returns as timeouts and
continued, which could cause a busy-loop if the socket had an error.
Now we call IsConnected() when Wait() returns false to distinguish:
- If socket has error: break out of loop with error message
- If genuine timeout: continue waiting for connections
This prevents CPU spinning when the socket is in an error state.
Co-authored-by: reuben <[email protected]>1 parent 9ce18cb commit 3e9337f
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
210 | 218 | | |
211 | 219 | | |
212 | 220 | | |
| |||
0 commit comments