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

Are we able to send or react to ping/pong message? #94

Open
zouh520sdo opened this issue Mar 28, 2024 · 2 comments
Open

Are we able to send or react to ping/pong message? #94

zouh520sdo opened this issue Mar 28, 2024 · 2 comments

Comments

@zouh520sdo
Copy link

I'm using the NativeWebSocket in Unity for my client. Things are working fine for me except for I don't find a way to send or react to ping/pong message for web socket. Is it supported by NativeWebSocket?

@endel
Copy link
Owner

endel commented Mar 28, 2024

Hi @zouh520sdo, as far as I know, it is not possible to interact with PING/PONG frames from the native System.Net.WebSockets. However, the underlying client handles them automatically https://github.com/dotnet/runtime/blob/dc9c9d5f9e23ff6aa0b99af8f6c410a0558fadaf/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/ManagedWebSocket.cs#L777-L781

@mikerochip
Copy link

mikerochip commented Apr 11, 2024

I'm using the NativeWebSocket in Unity for my client. Things are working fine for me except for I don't find a way to send or react to ping/pong message for web socket. Is it supported by NativeWebSocket?

@zouh520sdo If you want ping pong support and you want it to work on all platforms, try this instead https://github.com/mikerochip/unity-websocket?tab=readme-ov-file#customizable-ping-pong-support

You will need to customize your server to ignore the messages though

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

3 participants