Tuesday, August 5

Using Socket in Unity3D without Pro License

Recently I needed to add to our Unity3D plugin the ability to talk to another application via sockets. I'm a long time .NET developer and sockets is peace of cake to use. The problem start when I test the application on iPad device. During the building of XCode project from Unity I got the exception:

Error building Player: SystemException: System.Net.Sockets are supported only on Unity iOS Pro. Referenced from assembly 'Assembly-CSharp'.

As it turns out Unity3D AOT compiler check and fail if any of your script or the plugins you have uses System.Net.Sockets namespace without having pro license.

The solution is to use a plugin call Good Old Sockets which you can find right in the Assets Store of Unity3D. This library require only to change the namespace you are using from System.Net.Sockets to LostPolygon.System.Net.Sockets. The price is 25$ at this time and their license is very open, you can use and distribute this library without extra cost.

I had very quick response for support from LostPolygon both in mail and in Skype.