novastone-media / MQTT-Client-Framework

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

Crash at setQueue in MQTTDecoder #438

Closed shokaveli closed 6 years ago

shokaveli commented 6 years ago

Im crashing here due to _queue = nil. This started happening only after updating to latest version of MQTT-Client-Framework. Please help.

image

shokaveli commented 6 years ago

self.queue = dispatch_get_main_queue(); is returning nil

jcavar commented 6 years ago

That is really weird. What kind of app are you working on?

shokaveli commented 6 years ago

so I was able to fix by supplying the queue in my session init >

_session = [[MQTTSession alloc] initWithClientId:_clientId userName:_serverUsername password:_serverPassword keepAlive:WWMQCLIENT_DEFAULT_KEEPALIVE cleanSession:WWMQCLIENT_DEFAULT_CLEANSESSION will:NO willTopic:nil willMsg:nil willQoS:WWMQCLIENT_DEFAULT_QOS willRetainFlag:NO protocolLevel:3 queue:dispatch_get_main_queue() securityPolicy:nil certificates:nil];

Before I was setting it to nil like so >

_session = [[MQTTSession alloc] initWithClientId:_clientId userName:_serverUsername password:_serverPassword keepAlive:WWMQCLIENT_DEFAULT_KEEPALIVE cleanSession:WWMQCLIENT_DEFAULT_CLEANSESSION will:NO willTopic:nil willMsg:nil willQoS:WWMQCLIENT_DEFAULT_QOS willRetainFlag:NO protocolLevel:3 queue:nil securityPolicy:nil certificates:nil];

Hopefully this is how I am supposed to do it.

shokaveli commented 6 years ago

It doesnt crash anymore but my connection is timing out, possibly from a separate issue though.

jcavar commented 6 years ago

I think it is really weird that you get nil from dispatch_get_main_queue. But on another hand I don't think that is problem in this framework. If you suspect it might be please add some more info.

shokaveli commented 6 years ago

Yea i dont think it was a framework issue