Socket multicast will hang in UAP mode with any interfaces
The receiveTask will hang forever in UAP run: https://github.com/dotnet/corefx/blob/master/src/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs#L131, no matter what interface is set for MulticastOption.
This test will only fail in UAP mode (succeed in ILC run). I think it's probably related to app container. But even after I enabled loopback interface for the app, the test still hang. I will continue investigation by using debugger.
cc: @davidsh
The description of this issue is not accurate.
There are two test cases for testing socket multicast with different interfaces (https://github.com/dotnet/corefx/blob/master/src/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs#L85-L106). One is "any interface", the other is "loopback".
The hang is only happening with loopback interface. If disable MulticastInterface_Set_LoopbackSucceeds() from the beginning (i.e not running this method at all), the test MulticastInterface_SetAnyInterface_Succeeds() will always succeed. (I wrote a script to run it hundred times).
I opened this issue with "hang in UAP mode with any interfaces (not only loopback)", this is true as well. The repro procedures will be:
- Don't disable MulticastInterface_Set_Loopback_Succeeds(), let it run and hang
- Disable MulticastInterface_Set_Loopback_Succeeds()
- Now MulticastInterface_Set_AnyInterface_Succeeds() will hang
So I doubt for "any interface" option (index 0 means "any interface"), the choice for the interface is actually affected by some factors (in this case, whether MulticastInterface_Set_Loopback_Succeeds gets called or not is the factor).
I investigated into this, only found the parameter passed in (0 or 1) for choosing the interface will eventually used by Interop.Winsock.setsockopt(). I can't find information about this API for how to choose the interface, so I am not able to find the direct evidence to prove my doubt.
@davidsh @CIPop
Keep track in dotnet/corefx#21327. I will submit a PR to re-enable MulticastInterface_SetAnyInterface_Succeeds().
@caesar1995 this is still referenced by the ActiveIssue within the code. Please either update the code or the bug.
It's in the PR: https://github.com/dotnet/corefx/pull/21328/files#diff-19adc45fa233056f6babaef13639a1acR96