hivemq / hivemq-mqtt-client

HiveMQ MQTT Client is an MQTT 5.0 and MQTT 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and backpressure support
https://hivemq.github.io/hivemq-mqtt-client/
Apache License 2.0
847 stars 158 forks source link

com.hivemq.client.mqtt.exceptions.ConnectionClosedException: Timeout while waiting for PINGRESP #508

Open acaliaro opened 2 years ago

acaliaro commented 2 years ago

Expected behavior

On a Datalogic Joya Touch I change the wifi network. When I switch from network A to B, MqttClient reconnect. The device is online (if I open the browser I see web pages) but I have the exception

Actual behavior

com.hivemq.client.mqtt.exceptions.ConnectionClosedException: Timeout while waiting for PINGRESP

To Reproduce

Switch from wifi A to B, the mqtt reconnect but publish message goes to timeout

Steps

Reproducer code

Details

pglombardo commented 1 year ago

Hi @acaliaro - it's been a while since this issue has been posted. Is this still an issue for you?

I would think this is actually the correct behavior indicating that the socket connection from wifi A is no longer active/valid.

If you'd like me to take a look, could you share a snippet of code to reproduce how you are using the client?

acaliaro commented 1 year ago

HI It's been a long time and I honestly can't remember whether or not this problem has been fixed. We are not currently using this type of device, but we will probably have to go back to testing soon. I will update you thanks

pglombardo commented 1 year ago

Hi @acaliaro - understood. Thanks for the update. Let us know if so. I'd be happy to investigate.

shanjunmei commented 10 months ago

i use ssh connect to device ,monitor same issue ,during this period ,the ssh connection work fine ,at same time ,another device connect to same broker also work fine

com.hivemq.client.mqtt.exceptions.ConnectionClosedException: Timeout while waiting for PINGRESP Server mqtt disconnected /{ip}:{port} com.hivemq.client.mqtt.exceptions.ConnectionFailedException: io.netty.channel.AbstractChannel$AnnotatedNoRouteToHostException: null: /{ip}:{port}

pglombardo commented 6 months ago

Hi all, I've added a feature request #623 to improve the PINGREQ <--> PINGRESP behaviour during network changes.

Thanks for pointing this out!