TooTallNate / Java-WebSocket

A barebones WebSocket client and server implementation written in 100% Java.
http://tootallnate.github.io/Java-WebSocket
MIT License
10.47k stars 2.57k forks source link

Ping from JavaScript client #1315

Closed Varshaav16 closed 1 year ago

Varshaav16 commented 1 year ago

Describe what you would like to know or do I would like to send PING message from client

Describe the solution you'd considered Is there an option to send PING message in terms of Frame?
I am able to achieve ping-pong using send() but I want to do the same using Frames.

Additional context setConnectionTimeout() works for Java client but I am looking for something similar in JavaScript, so that the client can know when the server shuts down.

PhilipRoman commented 1 year ago

It looks like there is no browser function for sending ping frames. Your only option is to implement your own ping system with normal frames and handle it at the application layer.

Varshaav16 commented 1 year ago

ah thanks