novastone-media / MQTT-Client-Framework

iOS, macOS, tvOS native ObjectiveC MQTT Client Framework
Other
1.84k stars 465 forks source link

MQTT nextMsgId Freezes iOS app #421

Closed umer-sufyan closed 6 years ago

umer-sufyan commented 6 years ago

Hi, I am facing bit of strange issue , some time my app gets stuck on debugging i got that MQtt NextMsgID is causing that freeze, could you please suggest any work around for that.

umer-sufyan commented 6 years ago

Perhaps we need to subscribe topics in dispatch thread, Something like that?

dispatch_async(dispatch_get_main_queue(), ^(void) { [_mqttClass subscribeFeedMQtt:feedid]; });

jcavar commented 6 years ago

Which version of MQTT-Client-Framework are you using?

umer-sufyan commented 6 years ago

i have been updating my pod, so it should be latest, but seems like problem has been solved dispatch_async , after that i did not face that issue though. i am leaving this open till, as i am not sure, about freezing still! but so far so good, i just checked now, i did not face, usually i faced when my app resume from background. version is 0.9.7

umer-sufyan commented 6 years ago

I think you can find out that freeze with low network/bandwidth, what i did to check before subscribing if it is connected then only if only it is connected then go for subscribe, with low bandwidth , due to fluctuation of net , it might be in connecting stat most of the time that could cause freeze, not sure, but it is not happening to me any more with that trick ;) I am going to close this issue.