Commit 1e763aa
committed
fix: use socket.shutdown() in Python force_stop() for reliable disconnect
socket.close() and file wrapper close don't reliably interrupt a
blocking readline() on another thread in Python. socket.shutdown(SHUT_RDWR)
sends TCP FIN to the server immediately (triggering server-side
disconnect detection) and interrupts any pending blocking reads
across threads — matching Node.js socket.destroy() and Go conn.Close()
behavior.1 parent 49569b4 commit 1e763aa
1 file changed
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2259 | 2259 | | |
2260 | 2260 | | |
2261 | 2261 | | |
2262 | | - | |
2263 | | - | |
2264 | | - | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
2265 | 2267 | | |
2266 | | - | |
| 2268 | + | |
2267 | 2269 | | |
2268 | 2270 | | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
2269 | 2278 | | |
2270 | 2279 | | |
2271 | 2280 | | |
2272 | | - | |
| 2281 | + | |
2273 | 2282 | | |
2274 | 2283 | | |
2275 | 2284 | | |
| |||
0 commit comments