-
Hello, I have a test case where is 2 threads and in each of them I do something like that:
But sometimes (pretty often, but not always) one ListenerStart for one of the listeners fails with error WSAEADDRINUSE. I tried to replace creation of MsQuic listener with simple UDP listener (just closing old socket, and then creating and binding new one) and it succeeds only if SO_REUSEADDR socket option is set. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Possibly. So you've tried it out and it fixes your problems? Mind sending a PR with that to see how our CI fairs? |
Beta Was this translation helpful? Give feedback.
-
I have found what caused this problem. The thing I have programmed is the DLL. I have discovered, that another DLL from this app is using QProcess class of Qt library version 5.7.1. I have checked sources of Qt and discovered that this class actually starts process with bInheritHandles set to TRUE. When I manually have reset this value to FALSE all issues were gone. It is obvious that the issue was caused by the following: one of UDP socket handles was inherited by child process and that process didn't let socket handle to be closed, until that process stop. So there is nothing wrong with MsQuic itself. |
Beta Was this translation helpful? Give feedback.
I have found what caused this problem. The thing I have programmed is the DLL. I have discovered, that another DLL from this app is using QProcess class of Qt library version 5.7.1. I have checked sources of Qt and discovered that this class actually starts process with bInheritHandles set to TRUE. When I manually have reset this value to FALSE all issues were gone.
It is obvious that the issue was caused by the following: one of UDP socket handles was inherited by child process and that process didn't let socket handle to be closed, until that process stop.
So there is nothing wrong with MsQuic itself.