Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

全局websocket关闭问题-rxjava2版本 #38

Closed
kejunlu opened this issue Nov 12, 2018 · 1 comment
Closed

全局websocket关闭问题-rxjava2版本 #38

kejunlu opened this issue Nov 12, 2018 · 1 comment

Comments

@kejunlu
Copy link

kejunlu commented Nov 12, 2018

请问Application里初始化的全局websocket 如何关闭?使用
Disposable disposable = RxWebSocket.get(BASE_URL).subscribe();
if (disposable != null) {
disposable.dispose();
}
关闭后会自动重连,Rxjava2版本

@dhhAndroid
Copy link
Owner

你没理解对意思,是你在 调用 RxWebSocket.get(BASE_URL).subscribe()后,把返回的Disposable 存起来,然后在要关闭的时候,调用 disposable.dispose();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants