You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone, I’m facing an issue where I get disconnected after connecting. In my code, I’ve implemented logic to reconnect if it gets disconnected, but it keeps disconnecting again.
I need to subscribe to multiple topics and process their payloads. Could someone please help me out?
go func() {
for {
if !client.IsConnectionOpen() {
fmt.Println("Client is not connected!")
token := client.Connect()
token.Wait()
} else {
fmt.Println("mqtt is connect :)")
}
time.Sleep(1 * time.Second)
}
}()
Why? The library already includes this functionality (automatic reconnect).
With regards to the disconnections (which appears to be your real issue) you have not provided enough info to enable anyone to help (see the readme re common issues, where to ask for help, and what info to provide - in this case a minimal, reproducable, example is really needed).
Hi everyone, I’m facing an issue where I get disconnected after connecting. In my code, I’ve implemented logic to reconnect if it gets disconnected, but it keeps disconnecting again.
I need to subscribe to multiple topics and process their payloads. Could someone please help me out?
or in publish
The text was updated successfully, but these errors were encountered: