nhn / socket.io-client-unity3d

socket.io-Client for Unity3D, which is compatible with socket.io v1.x
Other
167 stars 42 forks source link

JSON parse error #1

Closed zzragida closed 7 years ago

zzragida commented 7 years ago

all samples not working because json parse exception.

here is call stack ArgumentException: JSON parse error: The document root must not follow by other values. UnityEngine.JsonUtility.FromJson[PollingUrlAnswer] (System.String json) (at C:/buildslave/unity/build/artifacts/generated/common/modules/JSONSerialize/JsonUtilityBindings.gen.cs:25) socket.io.SocketInitializer+c__Iterator0.MoveNext () (at Assets/Plugins/socket.io/SocketInitializer.cs:169) UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17) image

maybe json format changed socketio-unity-jsoninitializer-bug

zzragida commented 7 years ago

but python socket.io is correct working maybe node.js server sample or library bug? image

ppz0th commented 7 years ago

I'll try and check it ASAP~

zzragida commented 7 years ago

tested on Unity 5.6.1

By the way, my python socket.io sample not working completely on unity connect callback not called.

socket.On("connect", () => { Debug.Log("Hello, socket.io~"); // not called });

ppz0th commented 7 years ago

Hello~ Recently, socket.io upgraded to v2.0.2 and it's not working on 'socket.io-client-unity3d'. 'socket.io-client-unity3d' only supports upto v1.7.4. So if you're working on Node.js, plz downgrade socket.io v1.7.4. You can do that by 'npm install socket.io@1.7.4'

We'll make an issue related to v.2.0.2 compatibility and solve this ASAP~

zzragida commented 7 years ago

@ppz0th Confirm this issue i solve it. Thank you for comment.

smallmiro commented 7 years ago

Relative issue #2 Support socket.io v2.0.2. Closed this issue