I'm currently working with the Tyrus reference implementation of the Java Websocket API. I've successfully created a server endpoint that receives binary messages, text messages, and pong messages, but I'm stuck trying to get it to receive ping messages. I've searched through much of the Tyrus source code and read the Jave EE Websocket tutorial but neither demonstrate functionality for receiving pings (only for sending them). Does anyone know if this is something not possible with the current API? If not, could you point me in the right direction for receiving ping messages?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
You cannot process ping messages. JSR 356 (Java API for WebSocket) spec does state that the implementation have to always respond to ping without giving application any opportunity to interact with those requests.
You can only send pings and consume pongs:
Why do you want to do that?