The principle and basic use of AFNetworking

RunLoop inside AFN

  • AFN opens a thread dedicated to accessing network requests
  • In this threading method, he dispatch_oncemodifies the method sum with static
  • In order to ensure the security of this method and only open up a memory space, and ensure that his thread does not die
  • In this method he will call another 网络请求入口method

     
  • In this entry method he will create a RunLoop
  • Then add a NSMachPortport, the purpose is to have Source in it (because the RunLoop of Source can really run)
  • Then start RunLoop, loop through RunLoop continuously, send messages continuously, and let him do things.

 

 

 

https://www.cnblogs.com/NSong/p/5477783.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324978558&siteId=291194637