itisnajim / SocketIOUnity

A Wrapper for socket.io-client-csharp to work with Unity.
MIT License
379 stars 65 forks source link

Socket not connected on IOS device #44

Closed hackafein closed 1 year ago

hackafein commented 1 year ago

The output I got using the library works in android build but not in ios build. I tried to trace the error. _transport = new WebSocketTransport(_clientWebsocket, Options, JsonSerializer); It doesn't go below this line, I think the error may originate from here. while (_isConnectCoreRunning) is looping continuously but I am not getting any ping or pong or on connected logs.

Also I got this warning in xcode but I dont found any solution or relevant,


Thread Performance Checker: Thread running at QOS_CLASS_USER_INTERACTIVE waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions PID: 1343, TID: 208651 Backtrace

3 UnityFramework 0x0000000107856038 _ZN14il2cpp_baselib31Baselib_SystemSemaphore_AcquireENS_30Baselib_SystemSemaphore_HandleE + 28 4 UnityFramework 0x000000010783b45c ZN6il2cpp2vm13MetadataCache16GetGenericMethodEPK10MethodInfoPK17Il2CppGenericInstS7 + 384 5 UnityFramework 0x000000010781f11c _ZL25GetGenericMethodFromIndexi + 144 6 UnityFramework 0x000000010781ec1c _ZL29GetMethodInfoFromEncodedIndexj + 44 7 UnityFramework 0x000000010781ea20 _ZN6il2cpp2vm14GlobalMetadata25InitializeRuntimeMetadataEPmb + 96 8 UnityFramework 0x0000000108512160 UnityThread_FixedUpdate_mC11898F4E00DF830D8B2A93BD2E1E85332AF5CF0 + 56 9 UnityFramework 0x0000000107834ae4 ZN6il2cpp2vm7Runtime15InvokeWithThrowEPK10MethodInfoPvPS5 + 100 10 UnityFramework 0x000000010783492c _ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException + 84 11 UnityFramework 0x0000000106e0fabc _Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb + 112 12 UnityFramework 0x0000000106e1b668 _ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb + 120 13 UnityFramework 0x0000000106e2a1e0 _ZN13MonoBehaviour16CallUpdateMethodEi + 272 14 UnityFramework 0x0000000106c8c520 _ZN20BaseBehaviourManager12CommonUpdateI21FixedBehaviourManagerEEvv + 228 15 UnityFramework 0x0000000106d3ad54 _Z17ExecutePlayerLoopP22NativePlayerLoopSystem + 100 16 UnityFramework 0x0000000106d3ad94 _Z17ExecutePlayerLoopP22NativePlayerLoopSystem + 164 17 UnityFramework 0x0000000106d3aff0 _Z10PlayerLoopv + 272 18 UnityFramework 0x00000001072a1ca4 _ZL19UnityPlayerLoopImplb + 112 19 UnityFramework 0x00000001069c2d64 -[UnityAppController(Rendering) repaint] + 84 20 UnityFramework 0x00000001069c2cf4 -[UnityAppController(Rendering) repaintDisplayLink] + 76 21 QuartzCore 0x000000018f5c7fa4 E0E47B5D-2805-361D-88C4-875002B0244D + 167844 22 QuartzCore 0x000000018f6f53b8 E0E47B5D-2805-361D-88C4-875002B0244D + 1401784 23 UIKitCore 0x0000000190723498 59CBC9B5-30AE-396E-A269-A986640001BC + 6628504 24 UIKitCore 0x0000000190d6f410 59CBC9B5-30AE-396E-A269-A986640001BC + 13231120 25 UIKitCore 0x0000000190d6e5dc 59CBC9B5-30AE-396E-A269-A986640001BC + 13227484 26 CoreFoundation 0x000000018dfd1f34 725E49F4-653B-39BF-9A7A-8A3250911ECB + 876340 27 CoreFoundation 0x000000018dfde30c 725E49F4-653B-39BF-9A7A-8A3250911ECB + 926476 28 CoreFoundation 0x000000018df621d0 725E49F4-653B-39BF-9A7A-8A3250911ECB + 418256 29 CoreFoundation 0x000000018df77b8c 725E49F4-653B-39BF-9A7A-8A3250911ECB + 506764 30 CoreFoundation 0x000000018df7cec0 CFRunLoopRunSpecific + 612 31 GraphicsServices 0x00000001c7fd3368 GSEventRunModal + 164 32 UIKitCore 0x000000019047286c 59CBC9B5-30AE-396E-A269-A986640001BC + 3807340 33 UIKitCore 0x00000001904724d0 UIApplicationMain + 340 34 UnityFramework 0x00000001069c2898 -[UnityFramework runUIApplicationMainWithArgc:argv:] + 92 35 Barbut 0x0000000100d4bcac main + 60 36 dyld 0x00000001ac79e960 7B63C573-6161-3B33-A3A2-9944BA59722F + 88416

itisnajim commented 1 year ago

Hello, try to use the server/machine address ip instead of "localhost"

itisnajim commented 1 year ago

https://github.com/itisnajim/SocketIOUnity/issues/36 https://github.com/itisnajim/SocketIOUnity/issues/19

are you using http? https://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http

i don't know guys, maybe related to the player build settings, try multiple options out there and tell me how do you fix it !?

hackafein commented 1 year ago

I solved with updating Unity Version to 2022, thanks