Giter Club home page Giter Club logo

Comments (6)

dhhAndroid avatar dhhAndroid commented on July 21, 2024

你是不是用的wss,这个应该是ssl协议相关的问题

from rxwebsocket.

kejunlu avatar kejunlu commented on July 21, 2024

你是不是用的WSS,这个应该是SSL协议相关的问题
配置了TLS相关的setSSLSocketFactory,部分手机还是会这样 @dhhAndroid

from rxwebsocket.

dhhAndroid avatar dhhAndroid commented on July 21, 2024

在okhttp项目下,查看一下相关问题吧,这个属于兼容性问题。

from rxwebsocket.

dalingge avatar dalingge commented on July 21, 2024

谢谢 我已经解决

from rxwebsocket.

dhhAndroid avatar dhhAndroid commented on July 21, 2024

谢谢 我已经解决

请问是什么问题导致的? 我收录一下。

from rxwebsocket.

dalingge avatar dalingge commented on July 21, 2024

我们这边后台长时间没有给前端发送数据会主动把websocket断开,照成了部分手机(大部分是华为)各种莫名其妙ssl错误,报错后rxjava取消订阅但是请求线程还在执行,执行中抛出异常,就会导致这种问题!io.reactivex.exceptions.UndeliverableException 官方解决办法就是在Application 加错误拦截器
RxJavaPlugins.setErrorHandler(new Consumer() {
@OverRide
public void accept(Throwable throwable) throws Exception {
try {
if (throwable instanceof UndeliverableException) {
throwable = throwable.getCause();
}
if (throwable instanceof IOException) {
// fine, irrelevant network problem or API that throws on cancellation
return;
}
if (throwable instanceof InterruptedException) {
// fine, some blocking code was interrupted by a dispose call
return;
}
if ((throwable instanceof NullPointerException) || (throwable instanceof IllegalArgumentException)) {
// that's likely a bug in the application
Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), throwable);
return;
}
if (throwable instanceof IllegalStateException) {
// that's a bug in RxJava or in a custom operator
Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), throwable);
return;
}
XLog.w("Undeliverable exception received, not sure what to do", throwable);
} catch (Exception e) {
XLog.w("ErrorHandler捕获未知类型异常", e);
}
}
});

我这个可能也不是正确的解决办法

from rxwebsocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.