Unity WebGL issue : Fails to create thread

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

Super420
Posts: 6
Joined: 10 Jan 2017, 19:52

Unity WebGL issue : Fails to create thread

Postby Super420 » 14 Feb 2017, 18:44

Code: Select all

SystemException: Thread creation failed.
  at System.Threading.Thread.Start () [0x00000] in <filename unknown>:0
  at Sfs2X.Core.ThreadManager.Start () [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.BitSwarmClient.Connect (System.String host, Int32 port) [0x00000] in <filename unknown>:0
  at Sfs2X.SmartFox.Connect (System.String host, Int32 port) [0x00000] in <filename unknown>:0
  at Connection.Connect () [0x00000] in <filename unknown>:0
  at UnityEngine.Events.UnityAction.Invoke () [0x00000] in <filename unknown>:0
  at UnityEngine.Events.InvokableCall.Invoke (System.Object[] args) [0x00000] in <filename unknown>:0
  at UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0
  at UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0
  at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <filename unknown>:0
  at UnityEngine.UI.Button.Press () [0x00000] in <filename unknown>:0
  at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <filename unknown>:0
  at UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <filename unknown>:0
  at UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[System.Object].Invoke (System.Object handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <filename unknown>:0
  at UnityEngine.EventSystems.ExecuteEvents.Execute[Object] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) [0x00000] in <filename unknown>:0
  at UnityEngine.EventSystems.StandaloneInputModule.ProcessMousePress (UnityEngine.EventSystems.MouseButtonEventData data) [0x00000] in <filename unknown>:0
  at UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent (Int32 id) [0x00000] in <filename unknown>:0
  at UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent () [0x00000] in <filename unknown>:0
  at UnityEngine.EventSystems.StandaloneInputModule.Process () [0x00000] in <filename unknown>:0
  at UnityEngine.EventSystems.EventSystem.Update () [0x00000] in <filename unknown>:0
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMousePress(MouseButtonEventData)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent(Int32)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent()
UnityEngine.EventSystems.StandaloneInputModule:Process()
UnityEngine.EventSystems.EventSystem:Update()
 
(Filename: currently not available on il2cpp Line: -1)
So it doesn't work which is pretty frustrating.
Tried it on android and on normal .exe build and those worked fine, so can anyone help me?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Unity WebGL issue : Fails to create thread

Postby Lapo » 15 Feb 2017, 08:32

Hi,
please specify which version of Unity you're running, what platform you're exporting to, which SFS2X API version you're using and what browser you're testing with.

Also is this an example from our tutorials or your code?

Also, have you changed the SmartFox.ThreadSafeMode property?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
Super420
Posts: 6
Joined: 10 Jan 2017, 19:52

Re: Unity WebGL issue : Fails to create thread

Postby Super420 » 19 Feb 2017, 21:17

Lapo wrote:Hi,
please specify which version of Unity you're running, what platform you're exporting to, which SFS2X API version you're using and what browser you're testing with.

Also is this an example from our tutorials or your code?

Also, have you changed the SmartFox.ThreadSafeMode property?

Thanks

Unity 5.5.0f3, newest API. exporting to webgl, android and windows application. tested it on Chrome. :roll:

and i already have

Code: Select all

sfs.ThreadSafeMode = true;
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Unity WebGL issue : Fails to create thread

Postby Bax » 20 Feb 2017, 09:48

Please make sure you have all the required DLLs in your project (WebGL builds require a specific SmartFox.dll).
Follow the instructions here: http://docs2x.smartfoxserver.com/Gettin ... api-csharp
The reason why I'm pointing this out is that WebGL doesn't support threads, which in fact have been removed from the WebGL API.
If you are getting that error, I suspect you are using the wrong DLL in your project.
Also take a look at the configuration of one of our examples.
Paolo Bax
The SmartFoxServer Team

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 23 guests