Closed eromoe closed 2 months ago
Note that the log you're showing comes from Syncthing itself (even though it is shown within Syncthing Tray's UI) and it is also Syncthing itself that runs into this error. So it would be best to come up with steps to reproduce the problem using just syncthing.exe
and report the problem on https://github.com/syncthing/syncthing/issues/new/choose. It would also make sense to explicitly state the expected behavior which supposedly is that Syncthing tries harder on Windows to release ports that would otherwise end up as "preserved".
However, I'm not sure whether it'll be possible to output a better error message. The error message you've got ("An attempt was made to access a socket in a way forbidden by its access permissions.") is not wrong per-se and probably all that Windows provides as error message for this failing bind-call.
After digging, I found that windows may preserve some port (strange behaviour)
I honestly don't know much about this. When creating another ticket for Syncthing itself it would make sense to add links to the resources you found during your research as other's probably also don't know what you mean. (The only thing that come's to mind is SO_REUSEADDR
(see https://man7.org/linux/man-pages/man7/socket.7.html) but I'm not sure whether that's even a thing under Windows. EDIT: Looks like it is: https://learn.microsoft.com/en-us/windows/win32/winsock/using-so-reuseaddr-and-so-exclusiveaddruse)
When creating a ticket for Syncthing itself you can drop the link to it here.
Today I find icon became grey , tried many way without success. The logs is
But
netstat -aon|findstr "8384"
output nothing . After digging, I found that windows may preserve some port (strange behaviour)netsh interface ipv4 show excludedportrange protocol=tcp
:The damn preserved behaviour . So the error message is not accurate for debug . And it would be nice to automatically release the preserved ports ( which hyper-v takes ) .