Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity android build mysteriously stopped connecting to server, editor works fine #71

Open
dskill opened this issue Oct 5, 2022 · 3 comments

Comments

@dskill
Copy link

dskill commented Oct 5, 2022

I have a confusing problem where my Unity android build mysteriously stopped connecting to my glitch server. Earlier today, it worked fine. As of this evening, it silently fails without any output. For reference, this is how I'm opening my connection:
websocket = new WebSocket("ws://" + m_ServerIp, new Dictionary<string, string>() { { "User-Agent", "Unity3D" } });
but websocket.OnOpen() or websocket.OnError() are never called.

The code itself hasn't changed. So I'm running on weird theories like my android device updated itself and is now blocking the connection. Or perhaps glitch has changed something on the backend that is now causing the connection to fail (again only from an android build. Everything else seems fine).

Any suggestions on what might be going wrong, or how to better debug this? The silent failure has me stumped. Thx!

@dskill
Copy link
Author

dskill commented Oct 5, 2022

And.... as of this morning the android device is working again. I'm so confused :\

@endel
Copy link
Owner

endel commented Oct 5, 2022

Glitch turns off its servers per inactivity, it can take a few minutes for Glitch to turn them on by request. This library does not have any mechanism to retry on failed connection attempts.

@dskill
Copy link
Author

dskill commented Oct 5, 2022

I suspected something similar, but verified that I could log into the server and send/receive messages from Unity Editor and the browser during the period when my android device wasn't working.

If it happens again, is there any way to get more detailed log info about what might be happening? Thx for the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants