Search Unity

Bug [il2cpp][Windows 10 SDK 2004] UdpClient Broken

Discussion in 'Editor & General Support' started by Oamm, Jun 24, 2020.

  1. Oamm

    Oamm

    Joined:
    May 15, 2016
    Posts:
    8
    Hey there,

    Not entirely sure where to post this, hoping this can get it to the right place. I updated to latest windows 10 sdk 2004 - and the UdpClient is not functioning anymore. Downgrading the windows 10 sdk 1903 reverts the issue.

    I have a more detailed post, but it's being marked as spam.

    Project architecture: Unity 2019.4.1 lts, Visual Studio 2019, il2cpp

    The exception message thrown is: "value does not fall within the expected range" - I unfortunately don't have the callstack anymore.
    Code (CSharp):
    1.  
    2. // I recall it starting at UdpClient and ending at So ck etOpt ions
    3.  

    Issue is only present in outputted build. I didn't try without il2cpp.

    Code (CSharp):
    1.  
    2. try {
    3.     // using port 0 => underlining service provider assigns the port
    4.     m_udpClient = new UdpClient(new IPEndPoint(GetLocalIPAddress(), 0));
    5.     m_udpClient.Client.EnableBroadcast = true;
    6.     m_initialized = true;
    7. }
    8. catch (Exception e) {
    9.     Debug.LogError(e.Message);
    10. }
    11.  
     
    Last edited: Jun 24, 2020