Is local multicast (UDP via Sockets) via Il2cpp supported?

I’ve found that since the deprecation of Mono with Unity, I’ve been experiencing application crashes/halting (without any exceptions being thrown) when trying to add a membership to a socket.

A simple script on an object in the scene replicate this behavior:

private void Awake()
{
   Debug.Log("Creating Socket...");
   Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
   IPAddress IPAddress = IPAddress.Parse("239.255.255.250");
   Debug.Log("Setting Socket Option...");
   socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress, 0));
   Debug.Log("Successfully Set Socket Option...");
   socket.Close();
   Debug.Log("Closed Socket...");
}

In the editor, it successfully prints all the logs, but when running on the device, it halts execution and never prints “Successfully Set Socket Option…”

Notes:

  • Unity 2019.2.12f1
  • Reproducible for Windows Standalone w Il2cpp & PS4 (and possibly others, but not in editor)
  • Tested with and without Development Build checked. Same results.
  • Tested with 4.x and Standard 2.0, same results. (Baselining 4.x)

Up! Having the same issue.

UP! this fixed in .netCore3.1 ,however unity’s version is .netCore2.0

IPInterfaceProperties.GetIPv4Properties() aslo crash!

When did mono get depreciated? You mean .net 3.5?

.net 4.x,I found that unity’s runtime still mono. [5.11.0 (Visual Studio built mono)]