Hi, I have been testing the connection between my Unity Editor and Nakama Server running locally. However I got this error after I disconnecting socket:
System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake. ---> System.IO.IOException: Unable to read data from the transport connection: Operation aborted. ---> System.Net.Sockets.SocketException: Operation aborted
--- End of inner exception stack trace ---
This is my Disconnect Function:
public async void Disconnect()
{
if (_socket != null)
{
if (_socket.IsConnected)
await _socket.CloseAsync();
_socket.Connected -= ListenOnSocketConnected;
_socket.Closed -= ListenOnSocketClosed;
_socket = null;
}
_session = null;
_client = null;
_status = NakamaConnectionStatus.Disconnect;
}
The error happens while in game, this is what I did:
1. Connect
2. Disconnect
3. Connect
4. Disconnect -> WebSocketException
It seems fine for runtime but I need to know how to fix this or just letting it be and ignore the error.
- I’m using Linux - Fedora 43, Nakama Unity SDK version 3.19.0
- Nakama Server running in local using Docker Compose, version Nakama 3.34.1
Any answer and solution for this issue? I can provide more from my code that I made and currently still working on my game.