Search Unity

Networking in UNITY 5 , which one is better C# native API or UNET?

Discussion in 'UNet' started by julinalex07, Feb 6, 2016.

  1. julinalex07

    julinalex07

    Joined:
    Nov 21, 2015
    Posts:
    1
    Hi guys , I was working on a small game on Windows and i have to implement a network connection for real time communiction with a peer running on another computer or android device connected to the same Wi-Fi network .. since i was new to unity networking , i followed some tutorial and implemented a baic connection using C# UDP multicating ( i was planing on multicasting the data hence i used multicast , but the proposal was later dropped ) to send real time data ( the data is not for multiplayer or i would have gone with unity's own api for that) , but there is a little bit of latency in the connection say about 300ms or so .. (ping average is about 50ms). so i was thinking about rewriting the code , i was planing to switch to standard UDP one on one connection instead of mlticast and then reduce the size of the data beign sent ( currently it is about 14 chars , i could reduce it to 7 or chars).

    Now my doubt is that , should i use the C# native library to accomplish this or should i switch to Unity's Network transport layer api? would there be a speed difference (reliability is not much of a concern , beacuse it is real time data ,and since being inside the same small LAN loss levels are not going to be in the acceptable range) . and could there be some other factor causing the latency?