-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconnection issue #15
Comments
Yes, what is the actual issue that you are facing? |
when I use the library to app, it connect successfully, but sometimes it may disconnected, then I tried to in mqttDidDisconnect method call the connection method, like below code: |
From the error message, I guess the session delegate is getting deallocated. Also, what is |
Because I want the connection always keep alive. I use it to receive the other client published message. And if it disconnect, it should try to connect. The connect(session) method is like that : func connect(_ mqttSession : MQTTSession) -> Void {
mqttSession.connect {
if !$0 {
print("Error Occurred During connection \($1)")
return
}
mqttSession.subscribe(to: "topic", delivering: .atLeastOnce) { (succeeded, error) -> Void in
if succeeded {
print("Subscribed!")
}
}
}
}```
, Is everything right here ? |
i am using same SwiftMQTT only , canu tell me how subscribe with Messege, i am getting only subscribe name |
How to deal with the reconnection,? I try to in mqttDidDisconnect method call the connection method, Is it right action?
The text was updated successfully, but these errors were encountered: