objective-c - iOS开发中同时发起多个网络请求,这时如果网络中断,应该怎么处理?
PHP中文网
PHP中文网 2017-04-17 16:50:15
0
2
595

个人觉得网络中断,应该把请求线程全部取消

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
左手右手慢动作

Once the request thread is started, it must be completed and cannot be canceled.
Q&A Details
During iOS development, multiple network requests are initiated at the same time. What should I do if the network is interrupted?
There should be an interrupt handling mechanism for network interruptions.
1-Stop the current thread processing. If it is about downloading, you should resume the download after determining that the network connection is normal.
2-The current network is interrupted, and a reload request for the interface and network will be made after the end.

Peter_Zhu

Check the network and re-initiate the request

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template