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

Open
#71 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, csharp, unity

Research direction

Start with the Unity Android connection path using the reported WebSocket constructor and compare it with the working editor path. Trace why neither OnOpen nor OnError is called, using Android-specific diagnostics if available. Done means the Android build connects to the server again or reports a clear, actionable failure.

Written by the indexing model from the issue text.

Description

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!

Dominant language
C#
Stars
1.7k
Forks
206
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from endel/NativeWebSocket

All issues in endel/NativeWebSocket

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.