Closed Coloryr closed 1 month ago
Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.
Instead of binding in the constructor, we could implement some sort of lazy mechanism for Bind
in UdpClient
, but I'm not sure it's worth the investment. In general, we advise users to use Socket
directly instead of using UdpClient.
Triage: putting to Future tentatively, but we may close as wontfix. cc @wfurt
Description
Reproduction Steps
Expected behavior
After setting the properties of the socket, it works normally.
Actual behavior
InvalidOperationException
Regression?
No response
Known Workarounds
Socket bind before create it.
Configuration
Other information
I found UdpClient Bind to fast, so that the attribute cannot be set. https://github.com/dotnet/runtime/blob/513b503fe7ee58c4f602e2f60bf5a478995d4c84/src/libraries/System.Net.Sockets/src/System/Net/Sockets/UDPClient.cs#L83-L93