https://bugs.winehq.org/show_bug.cgi?id=50955
Bug ID: 50955 Summary: .netCore app can't bind to port shortly after another .netCore program binding to the same port was terminated Product: Wine Version: 6.5 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: besentv@gmail.com Distribution: ---
Created attachment 69784 --> https://bugs.winehq.org/attachment.cgi?id=69784 BrokenClient
I provided code for 3 different programs as attachment which represent extremely scaled down code of a bug I tried to find in a proprietary program:
BrokenServer and BrokenClient are both C# programs created for .netCore 3.1 (x86).
BrokenServer creates a socket, tries to bind it to port 41811 and ends up accepting all incoming connections on this port inside an infinite loop.
Broken Client tries to connect to the socked opened by BrokenServer and ends up in an infinite loop(seems important!?).
TestCode is to test what is actually broken in Wine: It runs a BrokenServer and 3 BrokenClients using CreateProcessA() and waits for getchar(). After that it stops all 4 processes using TerminateProcess() and immediately restarts the BrokenServer using CreateProcessA(). The server tries to bind to port 41811 but unlike on Windows it (almost) always fails to do so, showing a MessageBox with the information that the port is already in use.
As mentioned before, the infinite loop in BrokenClient seems to make a difference because I never encountered this issue without it. I wasn't able to recreate this problem with native code. Everything was tested in a clean prefix with .netCore x86 desktop ("windowsdesktop-runtime-3.1.10-win-x86") installed.