Search Unity

Any problems using standard C# sockets & threads?

Discussion in 'Multiplayer' started by JoeStrout, Jul 2, 2015.

  1. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I've got a client who wants a network API to stream position data from the simulator we're building. While I've done network programming before outside of Unity, and some UDP-based networking (based on a third-party library) within Unity, I've never done TCP sockets within Unity.

    So: would something like this, using standard .NET sockets and threads (System.Net.Sockets and System.Threading), work in Unity? Or is there some reason to expect trouble?

    Also, if you have another approach you would suggest for streaming data (to a client written in something completely different, not a Unity app), I'm all ears.

    Thanks,
    - Joe
     
  2. nventimiglia

    nventimiglia

    Joined:
    Sep 20, 2011
    Posts:
    153
    With the exception of WebGL, yes
     
    JoeStrout likes this.