- Home /
Photon and WebGL random error sending data
So first off Thanks for any help...
I'm using Photon with a webgl build. randomly when switching scenes i am receiving this error....
Exiting receive thread (inside loop). Server: wss://SLWASH002.exitgames.com:19090:0 Error: An error has occurred in sending data.
UnityEngine.Debug:LogError(Object)
NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1486)
ExitGames.Client.Photon.<ReceiveLoop>c__Iterator23:MoveNext() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/SocketWebTcp.cs:209)
The error typically only happens in the build version... but from time to time it does happen in the editor.
I have tried searching here googling and talking with others and i cant seem to figure it out. Thanks Again, Aaron
Hi,
you are saying that this happens randomly. Can you specify this a little more and tell us how often this happens? Is it like one or two out of ten times? Is it more or less? Or is it really random and you can't provide some more detailed information?
Also interesting is which loading function do you use when changing the scene. Is it Unity's built-in function using the Scene$$anonymous$$anager or is it Photon's PhotonNetwork.LoadLevel(...) function?
Additionally please let us know which Unity and which PUN version you are using, so we can investigate this behaviour.
@ChristianSimon completely random in editor. some times it happens once in a run. Sometimes not at all. In the built version.. it happens almost every time 8/10 times when loading between scenes. I am using unity 5.3.5f1 and the latest PUN version. and im using Scene$$anonymous$$anager. I acts like when it exits to lobby than reloads a scene it gets an abnormal disconnection when the websocket tries infor$$anonymous$$g the server. Thank you for any help.
This is interesting. I have a question about the scenes you are loading. Are these 'big' scenes with lots of objects and other stuff? I'm asking because I'm interested in the resulting loading times. Since WebGL is single-threaded there is a chance, that you get disconnected when loading a level because it simply takes too long. Please measure the time it takes to load another scene. This doesn't need to be very accurate, you can also do this with your smartphone's stopwatch. I just need some idea, how long it takes.
Additionally you can also try asynchronous loading by using LoadSceneAsync(...). If this doesn't work either, you maybe can try to create a repro project where we can do some testing on this behaviour.
Answer by albertduranll · Jul 07, 2020 at 04:48 PM
I've the same problem, any solution for this problem?
Answer by gamescorpion · May 18 at 01:24 PM
For anyone experiencing this issue => Exiting receive thread (inside loop). Server: XXXXX
Here is the solutions that have worked for our team:
Check to see if the scene that you are loading is not MASSIVE in size.
Check to see if the scene being loaded is not sending/receiving data in the first frame (Wait a while before sending/receiving sync information with Photon).
TO TEST AND SEE IF THIS IS THE CASE:
Create a FULLY EMPTY dummy scene in unity and add it to the build settings
Connect to Photon and try and use that EMPTY scene to see if works (Which it most likely should). This will alert you that your issue lies in the scene you were trying to load (Due to one of the above items OR something else in that specific scene).
Hope the above solution helps out others going through the same issues!
Nav Gupta => Former Unity 3D Live Help Expert Team Member and now Founder and CEO of Chaarmi Worlds Inc. making the future metaverse!! Check us out at Chaarmi.com!
Your answer
Follow this Question
Related Questions
Photon disconnects in WebGL 0 Answers
Photon Problem 0 Answers
WebGL build error on Unity 2021.2.8 0 Answers