Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Mono Upgrade DnsEndPoint problem with .net 4.6

Discussion in 'Experimental Scripting Previews' started by Seto, Mar 11, 2018.

  1. Seto

    Seto

    Joined:
    Oct 10, 2010
    Posts:
    243
    Code (CSharp):
    1. hostEndPoint = new DnsEndPoint("localhost", port, AddressFamily.InterNetwork);
    2. clientSocket = new Socket(hostEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
    3. SocketAsyncEventArgs connectArgs = new SocketAsyncEventArgs
    4. {
    5.     UserToken = clientSocket,
    6.     RemoteEndPoint = hostEndPoint
    7. };
    8. connectArgs.Completed += OnConnect;
    9. clientSocket.ConnectAsync(connectArgs);
    10.  
    When using the code above in normal .net project. It can run successfully. But with Unity .net 4.0 project, it reports "AddressFamilyNotSupported".

    I tried to use it without specify AddressFamily, both not working with normal .net project and unity .net 4.0 project.
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    This should work in Unity. Can you try the latest 2018.1 beta release? If that does not work, please submit a bug report. Thanks!
     
  3. Seto

    Seto

    Joined:
    Oct 10, 2010
    Posts:
    243
    Yes. I tried it with latest 2018.1 beta.
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Thanks! If you can drop us a bug report, we would appreciate it.
     
  5. Seto

    Seto

    Joined:
    Oct 10, 2010
    Posts:
    243
    Just submitted an issue. Use it to connect any server and reproduce. I'm testing with Unity 2018.1b10 on win 10.
     
  6. Seto

    Seto

    Joined:
    Oct 10, 2010
    Posts:
    243
    Here's the issue. case 1012875
     
    JoshPeterson likes this.