Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

UWP for WMR DatagramSocket not receiving UDP data

Discussion in 'Windows' started by Weezerin, Nov 20, 2018.

  1. Weezerin

    Weezerin

    Joined:
    Sep 7, 2012
    Posts:
    3
    I have an issue using DatagramSocket for receiving UDP data with Unity 2018.2.10f1 for deploying on Windows Mixed Reality Samsung Oddysey.

    I'm using the code from: https://gist.github.com/michaelosthege/857acac92b8ee689a6bb30d5bf23d9f6 to implement a UDP client to receive UDP data.

    But my application don't receive any data using this code:

    Code (CSharp):
    1. _Socket.MessageReceived += _Socket_MessageReceived;
    _Socket_MessageReceived method doesn't get called.

    What are doing wrong?

    Thanks in advise.
     
    Last edited: Nov 20, 2018
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,718
    Are you sending data from the same machine? Receiving data on UDP sockets is not supported if the sender is localhost. You need to send data from another machine.
     
    Weezerin likes this.
  3. Weezerin

    Weezerin

    Joined:
    Sep 7, 2012
    Posts:
    3
    Yes. It works, I didn't know it, that is not supported on the same machine. Thanks!
     
  4. Weezerin

    Weezerin

    Joined:
    Sep 7, 2012
    Posts:
    3
    Thank you. Do you know if in the same machine with two network interfaces it will work? Thanks
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,718
    No, it won’t work.