1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Useful UDP C++ code that needs improving

Discussion in 'Miscellaneous' started by traveltrousers, May 15, 2017.

  1. traveltrousers

    traveltrousers Active Member

    Joined:
    Jun 5, 2014
    Messages:
    116
    Location:
    Timbuktu, Tombouctou, Mali
    Balance:
    890Coins
    Ratings:
    +87 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform
    https://forum.unity3d.com/threads/simple-udp-implementation-send-read-via-mono-c.15900/

    has a couple of nice scripts that usually work, or at least I can use the receive script to grab UDP data from simtools. It doesn't handle errors very well, but I thought it would be useful for someone on here... especially if they have some suggestions for making it 100% reliable! :)
    • Useful Useful x 1
  2. traveltrousers

    traveltrousers Active Member

    Joined:
    Jun 5, 2014
    Messages:
    116
    Location:
    Timbuktu, Tombouctou, Mali
    Balance:
    890Coins
    Ratings:
    +87 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform
    update:



    The UDP section in this tutorial works perfectly to receive simtools UDP data and handles disconnects and reconnects perfectly! You just need to parse what you're getting...
    • Informative Informative x 1
    • Useful Useful x 1