android - 改造 ssl=0x717f870208:系统调用期间的 I/O 错误,对等方重置连接
问题描述
我的代码工作正常,我从服务器接收到数据,但突然出现此错误:
javax.net.ssl.SSLException: Read error: ssl=0x717c368708: I/O error during system call, Connection reset by peer
有时我也会收到此错误:
com.google.gson.stream.MalformedJsonException:
Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
我正在使用改造
implementation 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
implementation 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
这是它的初始化
Retrofit retrofit = new Retrofit.Builder().baseUrl(baseUrl).
addConverterFactory(GsonConverterFactory.create()).build();
Api api = retrofit.create(Api.class);
Call<ProfileResult> profileCallBack = api.getProfileData();
解决方案
我发现问题出在我的 ISP 中,它将我重定向到他们的网站以显示有关互联网消费的消息并停留在该重定向中,当我使用数据或其他 WiFi 运行应用程序时,它工作正常!
推荐阅读
- node.js - ExpressJS- GET 方法 -Json 数据 - Angular 4+
- c - 尝试输出此功能时,我什么也没有得到空白
- javascript - 两次调用相同的javascript函数timepicker
- python-3.x - 如何从 google-cloud-platform vminstance 中的 pubsub 回调函数调用全局变量?
- python - 连接多个 CSV 时出现内存错误
- c# - 如何在 C# 中模拟 OPC UA 会话以进行单元测试
- sitefinity - Sitefinity:针对不同环境配置的网站模板
- kubernetes - Istio 是否支持代理协议?
- excel - 在保护工作表中允许插入行和列,但仍然弹出警告消息,如何阻止?
- sql - SQL:连接两个表,取所有行并设置默认值