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?