http://bugs.winehq.org/show_bug.cgi?id=26031
--- Comment #67 from Artem S. Tashkinov t.artem@mailcity.com --- (In reply to comment #66)
Created attachment 47020 [details] Always use SO_REUSEADDR
After re-reading this bug, the kernel bug and the discussions in kernel netdev list started by Artem I created the simple attached patch that "solves" this issue.
SO_REUSEADDR on linux at least will not allow the same program to bind twice in the same port.
Keeping SO_REUSEADDR after the socket is closed is the key to allow the next process to bind to the same address.
Thanks a lot!