Open Sunny0218 opened 9 months ago
Hi @Sunny0218,
I'm happy to see you! If you don't want to try reconnecting to the broker, you can register the 'on-reconnect' event to determine when to disconnect the client (if reconnecting counter > 3 then disconnect it). Additionally, error messages would not be shown in a production environment.
Hi @Sunny0218,
I'm happy to see you! If you don't want to try reconnecting to the broker, you can register the 'on-reconnect' event to determine when to disconnect the client (if reconnecting counter > 3 then disconnect it). Additionally, error messages would not be shown in a production environment.
@tommy44458 Thank you for your reply. I would like to ask one more question based on your reply: Is the reconnect mechanism disconnected by the method "mqttHook.disconnect()"?
@Sunny0218 Yes, that's right.
Hello, it's me. The client keeps on trying to reconnect for me when I set keepalive to 0. Is there a way to disable the auto-reconnect mechanism? Also, is there any way to hide the error report in the console? Looking forward to your reply.