okhttp(四)
2019-04-15 本文已影响0人
流夕347
总结:


一、应用层
1.将请求添加到分发器中 client.dispatcher().executed(this)
2.创建拦截器ApplicationInterCeptorChain(对请求进行压缩、修改编码等处理)
二、逻辑层
1.数据缓存:
1)缓存的数据没有过期,直接使用
2)缓存的数据过期,先用过期的,然后再去网络请求数据
3)缓存的数据没有,直接从网络请求数据
2.底层使用连接池
3.路线选择器
4.网络拦截器可以有多个
三、链路层