novastone-media / MQTT-Client-Framework

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

add if (self.stream.streamStatus == NSStreamStatusOpen){} when close th… #460

Closed pantaopt closed 6 years ago

pantaopt commented 6 years ago

Close stream when stream.steamStatus != NSStreamStatusOpen,will crash EXC_GUARD

jcavar commented 6 years ago

Hi @pantaopt, thank you for your contribution. In which scenario this happens? Would it be possible to write test case that reproduces it?

pantaopt commented 6 years ago

@jcavar I am so sorry for response you so later!!!I am busing a litte,so so sorry!

pantaopt commented 6 years ago

@jcavar In fact,I'm not very good at write test。I need to learn how to write it.

jcavar commented 6 years ago

No problem, can you provide more info in which situations this could happen?

pantaopt commented 6 years ago

I used this library for a long time.I think the judgment conditions should be added outside before connection. Example for, if (!host || host.length<=0).I am closing this pr. Thank you very much for contributing this library!