Search Unity

Question regarding UNET depreciation and sockets

Discussion in 'Connected Games' started by Teracon, Jul 14, 2019.

  1. Teracon

    Teracon

    Joined:
    Jul 14, 2019
    Posts:
    3
    I'm putting together a game that only needs a fairly simple network API, basically sending messages from an authoritative server to the client. Do I need to be worried about the network API changing over much?
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,018
    Which network API are you referring to? Unet is dead, and only officially "supported" for the rest of 2019.x. It is not changing other than going away. As far as sockets, well you'd be creating your own network API in that case, so would only change if you make a change.
     
  3. Teracon

    Teracon

    Joined:
    Jul 14, 2019
    Posts:
    3
    All of the documentation I've seen refers to Unet though. I've done stuff with sockets before, and can write all the code for them, but can't find any of the documentation for it.
     
  4. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    78
    Joe-Censored likes this.
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,018
    Yeah, you'll be looking for generic C# examples of sockets, rather than Unity specific examples.

    I've found that ConcurrentQueue is very useful for moving data between your networking threads and the main thread, which since it is relatively new is often not in sockets example code.
     
  6. Teracon

    Teracon

    Joined:
    Jul 14, 2019
    Posts:
    3
    All right, thank you!
     
  7. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    78
    I think it's been there for at least 5-6 years now. The question is though... isn't the latest .Net more about async these days? I haven't done much networking recently, especially in C# but I've seen that recent examples are all about asynchronous programming. Would it be worth it to go down that route?
     
  8. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,018
    True, but requires setting .net 4.x which only came out of preview in 2018.1 I believe.

    I don't know the answer here.
     
    MrsPiggy likes this.