- Home /
.NET Socket Support for iOS/Android Basic
From the license comparison, .NET Socket Support is not supported by basic licensing of iOS or Android.
Can someone clarify what exactly this means? Does this simply mean that Unity does not supply a library of .NET Socket Functions, but I could create my own to interact with external services? Or does the absence of this feature mean that Unity Basic prevents me from implementing this functionality?
When I say "external services", I mean a basic example of an HTTP REST service for data input/output, or maybe a more complex entity like SmartFox Server for multiplayer capabilities.
My end-goal is to figure out whether or not I need Unity Pro to be able to interact with external services, or if this is still possible within Unity Basic (and Unity Pro only makes it "easier" to do).
Thanks for any help on clarifying this.
Answer by Dreamora · Jul 10, 2011 at 11:14 PM
The part in the license means that System.Net is basically missing when it comes to communication (widely used by 3rd party networking - multiplayer solutions, it includes the TCP and UDP Sockets required to talk to the web), which limits your communication to the web to plugin based solutions and WWW.
HTTP REST can be achieved through WWW by passing the data to the webservice in form of the WWWForm object and the webservice answer will be in www.text afterwards.
And you would not only need Unity Pro but Unity Pro + iOS Pro / Android Pro, as the desktop licenses don't apply to mobile in any other form than limit which licenses you can buy.
Thanks for the response. It is interesting that the lack of this feature really just translates to the lack of the System.Net library. What stops someone from including the necessary dll's as a plugin, or using a 3rd party socket library?
Well its not technically removed I think. But its useless. Without UDP and TCP sockets and the related client classes there is no use for System.Net anymore, cause the Requests classes don't work at all (they work or worked on standalone desktop but thats the only platform they ever worked at all - WWW is unitys intend and supported way for webrequests that uses the native platform way on each platform)
Dropping it in does not change it cause your code will not compile as long as you try to access something disabled. You would have to go through plugin and use the platforms native sockets that way (there are no 3rd party socket libraries for .NET that don't rely on System.Net sockets to my knowledge)
Answer by Dharwin · Aug 01, 2011 at 04:29 PM
I used a small workaround to achieve using the Android OS socket library, since .NET sockets are not supported with Unity's Android Basic license.
A tutorial on how I did this is here: http://devblog.twelve21.net/tutorials/mobile-socket-support-with-unity3d-basic-introduction/
Link is broken for me is there still a tutorial on how to do this out there?
Answer by ZimM · May 07, 2014 at 11:39 PM
Some time ago, I've released a plugin called Good ol' Sockets that enables you to use sockets on iOS/Android without the need for Pro license. It is really simple to use, basically, just a namespace change is required. Also works with other networking assets such as Tasharen Network, Photon Networking Free, UniWeb, BestHTTP etc
Answer by MechEthan · Mar 21, 2017 at 05:43 PM
As of Unity 5, System.Net.Sockets
is available for use on iOS and Android. (For any license, I believe.)
Your answer
Follow this Question
Related Questions
Android & PC socket connection 1 Answer
can I use one Game as Server and Client at the same time? 2 Answers
Question about Network.Destroy 0 Answers
Socket error in Android Build 1 Answer