Hey there!
I’m currently trying to start a game project with one specific goal in mind: I’d like the game to communicate with an Android Smartphone via WLAN (not using unity on that). So basically the game sends some information to the smartphone which also sends messages to the game to manipulate the game world. Right now I’m looking into unity to see whether it’s possible to implement something like that efficiently or not.
I already found a pretty good source to let unity act as a TCPClient that sends messages to an external server and immediately gets a response: Unity Buster: Unity 3D Client/Server Socket Connection Sample Code
However, for my game it will be necessary to constantly wait for information and use it when it arrives - in other words the TCPListener part needs to be in unity, not in the other program. So I’d like to know if there’s some kind of typical approach for something like that. I’m not really sure what part should be done in a javascript and what part in a C# script. Neither do I know if using threads is necessary or a good idea in general. Any guidance would be appreciated since I couldn’t find any information about this.