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

WebSocket is closed right after connection #98

Open
Kayrrhan opened this issue Dec 9, 2024 · 0 comments
Open

WebSocket is closed right after connection #98

Kayrrhan opened this issue Dec 9, 2024 · 0 comments

Comments

@Kayrrhan
Copy link

Kayrrhan commented Dec 9, 2024

I tried to use NativeWebSocket in Unity to communicate with a python server, which is based on Flask Socket IO.

I used the sample in the readme file just to try simple communication and when launching my app, the websocket is instantly closed after connection is done. I tried to investigate with the debugger tool and found out the issue might come from the Receive() method in WebSocket.cs :

result = await m_Socket.ReceiveAsync(buffer, m_CancellationToken);

Even though m_CancellationToken is set to false, after this instruction is done, my websocket state changes from 'Open' to 'CloseReceived' which leads to, as said, the closure of the websocket.

Did I miss anything in the setup of the NativeWebSocket or is this some kind of unwanted behavior out of scope?

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

1 participant