Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

UDP interaction

Discussion in 'Editor & General Support' started by unity_4J-FEv3jCWkBSQ, Jan 30, 2020.

  1. unity_4J-FEv3jCWkBSQ

    unity_4J-FEv3jCWkBSQ

    Joined:
    Jan 6, 2020
    Posts:
    9
    I am trying to send co-ordinates as string from one system to other, read the string in the next system and move a object accordingly. I am using UDP for the transmission purpose. I got the code to send and recieve string using UDP from the forum itself but it uses a dummy IP and port to connect which only works if both the programs i.e send and recieve are on the same system which does not suffice my requirement. I tried changing the IP to the IP of the other system but i can't figure should i change the port to something or is it any other thing.
    Can someone tell how to know the port of any server or what should i change?

    I used the code from
    https://forum.unity.com/threads/simple-udp-implementation-send-read-via-mono-c.15900/
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Well you'd change the port if you want to use a different port. I'm not really sure what you're getting at. Do you understand what IP addresses and port numbers are for? If not I'd suggest learning about the IP and UDP protocols, which is not really something you should expect to be taught here.
     
    unity_4J-FEv3jCWkBSQ likes this.
  3. unity_4J-FEv3jCWkBSQ

    unity_4J-FEv3jCWkBSQ

    Joined:
    Jan 6, 2020
    Posts:
    9
    Yes sir we know that we tried changing the ip and then the ports to those port who are open.
    But then also it didn't work. Do we need to do something specific in this ?
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    It depends on what specifically didn't work. You'll need to figure out exactly where the problem is occurring, but you haven't provided enough information for anyone to even guess. Might be software firewall, might be a code issue, might be a a wrong setting somewhere. Add a liberal dose of Debug.Log and possibly a tool like Wireshark to figure out where the failure is occurring.