eclipse / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.14k stars 887 forks source link

paho.mqtt.java does not handle ping/pong requests from libwebsocket #912

Open hansschoen-mway-io opened 2 years ago

hansschoen-mway-io commented 2 years ago

Hi. We are using the Mosquitto MQTT server along with libwebsocket library (https://libwebsockets.org) v4.1. On client side we use the paho.mqtt.java library (v1.2.5). MQTT Protocoll version is v3.1.

Problem: The MQTT broker frequently triggers every 5min a client ping request and the libwebsocket sends this request to the Java client. The WebSocketFrame.java receives this ping request (Opcode = 0x9) and throws an IOException("Invalid Frame: Opcode: 9") (line 193). This exception ist catched in WebSocketReceiver.java (L121) and results in a close of the connection.

Expected behaviour: When the paho.mqtt.java library is receiving the ping opcode (0x9) (https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.2) it replies the request with the pong code (0xA) (https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.3).

Can you please fix the ping/pong handling in paho.mqtt.java. Would be great. Regards, Hans

tom42530 commented 1 year ago

Hi.Any news on it?

Regards