- Home /
What socket API will work correctly with Unity?
I'm writing a simple client/server game. So I need a way to exchange my TCP messages with the server.
The problem is that *Async methods of System.Net.Sockets.Socket don't work well in Unity - I get "too many root sets" GC error in Editor and in Windows build - so I had to switch to synchronous methods. I'm using Unity 3.3 and I've already sent the bug report.
But it is not a good idea to mix IO operations with the game loop.
So the question is, what is the best method (API) to exchange custom formatted TCP data between Unity and the server?
Answer by Dreamish · Aug 27, 2011 at 12:35 PM
See the first answer of this question:
http://answers.unity3d.com/questions/15422/unity-project-and-3rd-party-apps.html
It provides code for using TCP sockets within Unity.
Your answer
Follow this Question
Related Questions
Why i can't receive 2 messages in a row from my server in Unity? 2 Answers
Async execution with blocking methods 0 Answers
TCP responses are not receiving properly on client side. 1 Answer
Unity TCP async functions 0 Answers
TCP and Sockets in unity 0 Answers