TcpClient available on all platforms Unity support

2019-08-09 05:51发布

问题:

I've read a lot of Q&A about using .NET's TcpClient in Unity, and it appears to be possible. What I'm wondering, because I just got burned by investing many hours in a NetworkView solution, only to find out it isn't supported for Windows Store builds (this fact isn't listed anywhere in the docs that I can see). If I write my client code using TcpClient, will it work on every platform that Unity 4.3 currently supports? Mostly I care about Android, iOS, and Windows Store, but who knows what the future holds, and I'm using Unity because of the cross-platform support.

I would just test it myself... but I don't have easy access to all of these platforms, and don't have test code written yet.

I have 15+ years of network programming experience, so not afraid of using low levels, don't really need or want any 3rd party libraries... was only going with Unity's built-in networking because I figured it would be the one thing that for sure was supported on all platforms.

Edit: I'm currently using the free version of Unity, if it matters.

回答1:

It's supported on Android, iOS and Mac/PC.

It's not supported in Windows Store Apps and Windows Phone 8. I don't know about the rest. More info on Windows platforms here.