Repository: godot
Issue: Game Crash - Websocket issue on Android devices?
Labels: bug,platform:web,platform:android,crash

### Tested versions

Tested on both v4.2.2.stable and v4.3.beta3 (MONO)

### System information

Vulkan 1.3.269 - Forward Mobile - Using Device #0: ARM - Mali-G710

### Issue description

Firstly, I'd like to point out that this issue only occurs when remote debugging my game on my Android device (Google Pixel 7 Pro).

I'm using Nakama as a backend, but I have a feeling this issue happens whenever a WebSocket tries to connect.
Contacted the Nakama team and they mentioned that "[They] use the standard ClientWebSocket type from the .NET Standard 2.0 profile without any special usage".

I do not get any specific errors, the game simply crashes whenever I'm calling `socket.ConnectAsync()`.
From a few different log points, I'm getting theses console warnings/errors:

[LOGCAT]:
```
2024-07-18 00:38:06.088 15732-15813 godot                   net.swordfall                        E  USER ERROR: BUG: Unreferenced static string to 0: Physics2DConstraintSolveIslands
2024-07-18 00:38:06.088 15732-15813 godot                   net.swordfall                        E     at: unref (core/string/string_name.cpp:127)
2024-07-18 00:38:06.092 15732-15813 godot                   net.swordfall                        E  USER ERROR: BUG: Unreferenced static string to 0: Physics2DConstraintSetup
2024-07-18 00:38:06.092 15732-15813 godot                   net.swordfall                        E     at: unref (core/string/string_name.cpp:127)
2024-07-18 00:38:06.093 15732-15813 godot                   net.swordfall                        E  USER ERROR: BUG: Unreferenced static string to 0: Variant
2024-07-18 00:38:06.093 15732-15813 godot                   net.swordfall                        E     at: unref (core/string/string_name.cpp:127)
2024-07-18 00:38:06.093 15732-15813 godot                   net.swordfall                        E  USER ERROR: BUG: Unreferenced static string to 0: .
2024-07-18 00:38:06.093 15732-15813 godot                   net.swordfall                        E     at: unref (core/string/string_name.cpp:127)
```

[SERVER LOGS]:
`"Error reading message from client","uid":"ce3c51aa-e4f0-4095-8a75-44b1b922753e","sid":"203bdedc-3e7f-11ef-9539-7106fdcb5b46","error":"websocket: close 1006 (abnormal closure): unexpected EOF"}`

---- I also get these errors ----
When connecting:
`"Error reading message from client","uid":"238e47fa-0ca1-43f0-aeb4-eadd9ee983ac","sid":"16652607-3e80-11ef-9539-7106fdcb5b46","error":"read tcp my.server.ip->my.personal.ip: read: connection reset by peer"}`
When disconnecting:
`"Could not send close message","uid":"238e47fa-0ca1-43f0-aeb4-eadd9ee983ac","sid":"16652607-3e80-11ef-9539-7106fdcb5b46","error":"write tcp my.server.ip->my.personal.ip: write: broken pipe"}`


I've seen a few issues on here with similar logs, so hopefully this can help the investigation.
This is truly a time consuming hunt that causes trouble to a lot of C# users.

### Steps to reproduce

As far as I know, a websocket connection will cause this issue, whether it's from Nakama or directly from the ClientWebSocket class.


### Minimal reproduction project (MRP)

-