novastone-media / MQTT-Client-Framework

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

when I use Asyn API [session connect], where can I set time out #538

Open hmxxxhhh opened 5 years ago

hmxxxhhh commented 5 years ago

I use the asyn api connect ,When the network is not good, I get a mistake like this nw_socket_handle_socket_event [C10:1] Socket SO_ERROR [60: Operation timed out], this is a time out error, the time is too long , I want know where can i set time out ?

jcavar commented 4 years ago

There are different timeouts that you can set: https://github.com/novastone-media/MQTT-Client-Framework/blob/master/MQTTClient/MQTTClient/MQTTSession.h#L384-L402

osamaazmat commented 4 years ago

@hmxxxhhh how did you solve this issue?

hmxxxhhh commented 4 years ago

I use its synchronous method [session connectAndWaitTimeout:] in an asynchronous thread

------------------ 原始邮件 ------------------ 发件人: "novastone-media/MQTT-Client-Framework" <notifications@github.com>; 发送时间: 2020年8月4日(星期二) 中午1:20 收件人: "novastone-media/MQTT-Client-Framework"<MQTT-Client-Framework@noreply.github.com>; 抄送: "青梅"<985319848@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [novastone-media/MQTT-Client-Framework] when I use Asyn API [session connect], where can I set time out (#538)

@hmxxxhhh how did you solve this issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

osamaazmat commented 4 years ago

@hmxxxhhh Thankyou so much. I'll try with this function.