Good ol' Sockets (.NET sockets for mobile without Unity Pro) [Released]

1517928--86599--$logo_only.png
v2.0.0

Asset Store Link

This plugin is only useful for Unity 4 free version users. Built-in sockets are already enabled for Unity 4 Pro and Unity 5 users.

Good ol’ Sockets is a drop-in substitute for System.Net.Sockets namespace subset. It is designed to make it possible for Unity developers to use sockets on Android and iOS platforms without a Pro license. It also includes an automatic patcher tool that allows to convert popular assets (such as Photon Networking Free, Tasharen Networking, UniWeb and others) in a single click!
Good ol’ Sockets aim to replicate the API of .NET sockets as close as possible. What this means for you is that you can use pretty much any code that uses System.Net.Sockets, including MSDN and hundreds of tutorials over the Web. Two simple commented demo scenes are also included.

Note: Good Ol’ Sockets are slower than native Unity implementation, and do not implement whole System.Net.Sockets and System.Net namespaces. However, this won’t affect most applications, as sockets are rarely the bottleneck, and the chosen API subset is sufficient for almost any needs.

A free evaluation version is available upon request to contact@lostpolygon.com or PM on forums.

Features:

  • Full support for Unity 4.x - 5.x versions. Android and iOS platforms are supported.
  • Allows to use .NET sockets on Android & iOS without the need for Pro license.
  • Allows to run a lot of popular assets, such as Tasharen Network, Photon Networking Free, UniWeb and many others.
  • Automatic patcher tool that detects and fixes socket usage in scripts and .dll.
  • Easiest possible code porting - just change the namespace and you’re done!
  • Replicates the .NET sockets API to the tiniest details.

Documentation:
Good ol’ Sockets - User Manual.pdf

If you like the asset, please review/rate it on the Asset Store, I’ll greatly appreciate that :slight_smile:

2 Likes

Pretty sweet. This might save me from needing to pay 7500 for licenses. How much of a performance decrease might this create using uniweb?

Also, any chance of try-before-you-buy?

$7500? But Pro licenses for iOS+Android is $1500+$1500, isn’t it?
Performance decrease for asset like UniWeb is negligible, I don’t think it’d be actually possible to notice any difference.

Also, check your PM.

I think it would be 1500 for pro, 1500, for android, and 1500 for ios. So that’s 4500. Not sure where I got 7500 from. Even with blackberry and team license it’s 6500. That might have been what I meant to say.

Hey ZimM,

Came across your pluggin on reccomend from the BestHTTP plugin dev. Our team is trying out BestHTTP to replace WWW class, but we don’t want to purchase 5+ seats of pro licenses so we can design / QA. Your plugin is exactly what we’re looking for.

BUT:

When I attempt to run Tools > Lost Polygon > Patch , I get the following error:

MissingMethodException: Method not found: ‘Mono.Cecil.TypeReference.set_Scope’.
System.Collections.Generic.List1[Mono.Cecil.TypeReference].ForEach (System.Action1 action) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:361)
A.A.A (Mono.Cecil.AssemblyDefinition , System.String , System.String , Mono.Cecil.AssemblyNameReference )
A.A.A (System.String )
A.B.A (System.String[ ] )
A.c.A ()

I can see the class Mono.Cecil.dll included in the Editor folder. Come across this before?

Hi there,

that’s weird, I haven’t encountered this issue before. Can you please try importing just BestHTTP+Good ol’ Sockets in a new project and see if it works then?

I was able to get it to work in a new project with only BestHTTP and Good Ol’ Sockets imported. Brought the updated files back into my project and exported without a hitch. Thanks for the suggestion.

That bug was probably caused by some conflicting dll’s in your project, or maybe Unity was just behaving weird… But anyway, glad you got it working :slight_smile:

Version 1.1 update is now live at the Asset Store!
Changelog:

  • Fixed some compatibility issues (make sure to update if you are using Tasharen Network!).
  • Fixed build on Windows Phone platform (build no longer crashes when Good ol’ Sockets are in the project).
  • Improved assembly patcher.

I just purchased this awesome asset, I can’t thank you enough for this! :smile:

Thanks! :slight_smile: Be sure to ask if you have any questions.

hi!
I have a really stupid question :
Does this plugin work with standard unity network?

Standard Unity network does not uses .NET sockets, so the question doesn’t really applies. Standard networking works on all platforms on free version of Unity.

Version 1.2 update is now live at the Asset Store!
Changelog:

  • Added an option to revert the namespace patch.
  • Added System.Net.CookieContainer support.
  • Improved demos.

I have to inform everyone who uses Good ol’ Sockets that current version v1.2.3 contains a bug, preventing correct work with Tasharen Network and, probably, some other assets. The fix is already submitted to the Asset Store, but it may take a few days to get approved, so meanwhile, just PM me with your invoice number and I’ll send the update to you. Sorry for all the inconvenience.

  • Serhii

Hi everyone,
the 1.2.4 update is now live on the Asset Store and includes the fix for issues introduced in 1.2.3, and also has added TNet 1.9.6b compatibility.

On Mac, building the project fails. I followed the instruction in the “known issues” section. But default runtime in monodevelop does not changed.

What do you mean under “does not changed”? I’ve just repeated the steps and it works fine. Have you clicked the “Set as Default” button?

1714363--108033--2014-07-28_16-05-10.jpg

Oh, just did some googling and it seems like sometimes it doesn’t gets applied to the project automatically. In that case, go to Project → Active Runtime and select the Unity runtime from there:

When I attempt to build, I get the following error:

Cross compilation job uLink.dll failed.
UnityEngine.UnityException: Failed AOT cross compiler: /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/Tools/OSX/mono-xcompiler --aot=full,asmonly,nodebug,static,outfile=“uLink.dll.s” “uLink.dll” current dir : /Users/jeongsuhong/Downloads/New Unity Project 5/Temp/StagingArea/Data/Managed
Env: Apple_PubSub_Socket_Render = ‘/tmp/launch-lqa7tt/Render’
LOGNAME = ‘jeongsuhong’
__CHECKFIX1436934 = ‘1’
MONO_PATH = ‘/Users/jeongsuhong/Downloads/New Unity Project 5/Temp/StagingArea/Data/Managed’
MONO_DEBUG = ‘explicit-null-checks’
TMPDIR = ‘/var/folders/hk/h85pcv911db8vwx3g902n71m0000gn/T/’
USER = ‘jeongsuhong’
SSH_AUTH_SOCK = ‘/tmp/launch-qe29cn/Listeners’
GC_DONT_GC = ‘yes please’
SHELL = ‘/bin/bash’
__CF_USER_TEXT_ENCODING = ‘0x1F5:3:51’
GAC_PATH = ‘/Users/jeongsuhong/Downloads/New Unity Project 5/Temp/StagingArea/Data/Managed’
HOME = ‘/Users/jeongsuhong’
PATH = ‘/usr/bin:/bin:/usr/sbin:/sbin’
result file exists: True. Timed out: False
stdout:
stderr:

at UnityEditor.MonoProcessUtility.RunMonoProcess (System.Diagnostics.Process process, System.String name, System.String resultingFile) [0x00000] in :0
at UnityEditor.MonoCrossCompile.CrossCompileAOT (BuildTarget target, System.String crossCompilerAbsolutePath, System.String assembliesAbsoluteDirectory, CrossCompileOptions crossCompileOptions, System.String input, System.String output, System.String additionalOptions) [0x00000] in :0
at UnityEditor.MonoCrossCompile+JobCompileAOT.ThreadPoolCallback (System.Object threadContext) [0x00000] in :0
UnityEditor.HostView:OnGUI()