Search Unity

Net.Sockets (udp) vs Unity Networking

Discussion in 'Multiplayer' started by alexr1221, Sep 9, 2017.

  1. alexr1221

    alexr1221

    Joined:
    Mar 5, 2016
    Posts:
    70
    Hi,
    I read in this thread http://answers.unity3d.com/questions/1313935/llapi-vs-pure-cnet-sockets.html that unity networking would be more performant than a basical c# sockets architecture, which seemed a bit strange to me. I found nothing else concerning performances comparison between them. So which option would be more perfomant for a simple send/receiving message architecture?

    Thanks per advance,
    Alexandre
     
  2. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    They don't know what they are talking about. The performance difference comes from crossing a native boundary, which you pay for basically accessing anything in the engine via .NET. .NET sockets just call the same native sockets api's that you use in C++, so there is no difference there at all at the socket level itself.

    The real performance cost of networking is in serialization and how you buffer data, and at some point that has to happen in .NET, you can't get around it.
     
  3. alexr1221

    alexr1221

    Joined:
    Mar 5, 2016
    Posts:
    70
    Thank you for the clarifications! I took a look at Game Machine, it looks very interesting. I've been searching for a long time a such clear / optimized networking architecture