WebSocket Error #1006

Hello there!

I’ve been debugging my mobile game, using Godot C#, directly on my PC but decided to test it out on my Android device before continuing any further.

To my surprise, when calling socket.ConnectAsync() the game immedietly crashes without any errors. Thankfully with Nakama’s logger I came across the errors below.

Everything works perfectly fine on PC, except these two errors that do not seems to break the game:
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"}

Only crashes on Android.
If anyone could help me figure this out, I would appreciate it!
Here’s the error that makes the game unplayable on my Google Pixel 7 Pro:

"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"}

Versions: Nakama .NET SDK {3.12.1}, {Ubuntu w/ Docker}

Anyone could help me out with this, please?

@ShadoW Do you know if there’s any known issues with Godot C# and the System.Net.Socket namespace? We use the standard ClientWebSocket type from the .NET Standard 2.0 profile without any special usage. You can see the whole code for the implementation here:

nakama-dotnet/Nakama/WebSocketStdlibAdapter.cs at master · heroiclabs/nakama-dotnet · GitHub

The initial suggestions I have on this issue are:

  1. Is it possible to update to a newer release of the Godot C# integration which may have resolved some issues with how the code is compiled to native code?
  2. Have you set up the correct network policies for your game with the Android manifest?

Cómo conectarse a una red  |  Connectivity  |  Android Developers

@novabyte Not that I’m aware of.
I’m currently using both latest version of Godot and Nakama.
I’ll try using a beta version and see if it fixes it.

About my AndroidManifest, I made sure it had network permissions enabled but still doesn’t work.