okhttp socket
时间: 2023-09-11 11:13:13 浏览: 98
okhttp
在OkHttp中,使用了AndroidPlatform来实现Socket的连接。具体来说,它的connectSocket方法中,通过socket.connect方法进行网络连接。在连接过程中,可能会出现一些异常情况的处理,比如AssertionError、SecurityException和ClassCastException等。关于ClassCastException异常,这是Android 8.0中的一个BUG,可以参考链接https://issuetracker.google.com/issues/63649622。总的来说,OkHttp通过实现AndroidPlatform的connectSocket方法来进行Socket连接。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [OkHttp 源码解析(二)打开 socket 请求](https://blog.csdn.net/XAVI_2010/article/details/104626669)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [undefined](undefined)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文