Repository navigation
Commit 7173b1b
committed
fix(client): find Windows port owners without netstat text
The Windows listener check parsed netstat and matched the STATE column
against "LISTENING". Windows localizes that column (ABHOREN, ECOUTE), so on a
non-English install ownsListeningPort never found the owner. Recovery then only
deleted the registration instead of terminating the stuck service, and the
replacement could not bind the port the stuck service still held.
Ask the OS instead: Get-NetTCPConnection -State Listen -LocalPort <port> and
read OwningProcess. Cmdlet and parameter names are not localized, the result is
structured, and the query is scoped to one port, so a busy machine cannot
overflow the output. This runs only after the owner has been silent past the
recovery window, so a cold PowerShell start is off any latency-sensitive path;
the timeout is 5s to cover it.1 parent 6deb880 commit 7173b1b
1 file changed
Lines changed: 19 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
204 | 210 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
210 | 221 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
215 | 225 | | |
216 | 226 | | |
217 | 227 | | |
| |||
0 commit comments