paho.mqtt.javascript icon indicating copy to clipboard operation
paho.mqtt.javascript copied to clipboard

MQTT Error Code 7 - AMQJS0007E Socket error: Unknown socket error

Open benjaminle9x opened this issue 3 years ago • 7 comments

I'm trying to use one Client (Mobile App) to subscribe to multiple topics at the same time. It works at first but then it keeps disconnecting my previous subscribed topics and shows this error message "AMQJS0007E Socket error: Unknown socket error". Instead, I want all the connections to be alive so I can receive real-time data instead of keeping reconnecting all the time.

Please help me resolving this issue.

Thank you.

benjaminle9x avatar Jun 30 '21 02:06 benjaminle9x

the same issue. I subscribe a topics. The logs show "onConnectionLost:AMQJS0007E Socket error:undefined.', 7" or "onConnectionLost:AMQJS0008I Socket closed.', 8" and then reconnecting successful. 我想到的唯一方法就是把keepAliveInterval设置的尽可能长。

inkCrazy avatar Jul 21 '21 06:07 inkCrazy

the same issue. I subscribe a topics. The logs show "onConnectionLost:AMQJS0007E Socket error:undefined.', 7" or "onConnectionLost:AMQJS0008I Socket closed.', 8" and then reconnecting successful. 我想到的唯一方法就是把keepAliveInterval设置的尽可能长。 keepAliveInterval: integer [0..65535] (CONNECT)

inkCrazy avatar Jul 21 '21 06:07 inkCrazy

the same issue. I subscribe a topics. The logs show "onConnectionLost:AMQJS0007E Socket error:undefined.', 7" or "onConnectionLost:AMQJS0008I Socket closed.', 8" and then reconnecting successful. 我想到的唯一方法就是把keepAliveInterval设置的尽可能长。 keepAliveInterval: integer [0..65535] (CONNECT)

inkCrazy avatar Jul 21 '21 06:07 inkCrazy

Some disconnection errors are due to reuse the same clientID. If a client connects with the same clientID, the previous client is disconnected with error 7 or 8. Try to use a unique clientID or randomize it.

punkman avatar Oct 24 '21 00:10 punkman

any solution?

jatin-bhuva avatar Apr 22 '24 12:04 jatin-bhuva