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消息,只回调了一次 #45

Open
chenhuaqiang6 opened this issue Aug 26, 2019 · 5 comments
Open

同时接收两条websocket消息,只回调了一次 #45

chenhuaqiang6 opened this issue Aug 26, 2019 · 5 comments

Comments

@chenhuaqiang6
Copy link

同时接收两条websocket消息,只回调了一次

@0xZhangKe
Copy link
Owner

@chenhuaqiang6 重现步骤

@chenhuaqiang6
Copy link
Author

服务器发的websocket消息比较多时,看时间戳,有两条消息时间戳一样,几乎是同时过来的,activity中,public void onMessage(String message, T data) {}这个回调只看到一条消息,有一条没回调,但在WebSocketWrapper中,LogUtil.e(TAG, "WebSocket received message:" + response.toString());能看到打印两条消息

@0xZhangKe
Copy link
Owner

@chenhuaqiang6 这个问题我没有复现过。

@viewholder
Copy link

我这边也出现了这样的问题,就是服务器几乎同时推送过来多条数据,public void onMessage(String message, T data) {}这个回调里面会出现丢数据的情况

@benben1
Copy link

benben1 commented Sep 16, 2020

TextResponse 下的onResponse方法里面的dispatcher.onMessage(responseText, delivery);可以打印收到的消息,然后delivery.onMessage(message, ws);也可以转发消息 但是在Activity中继承的SimpleListener 下 public void onMessage(String message, T data) 中接收消息 总会出现偶尔接收不到消息的问题(未找到必现方法 但是不定期出现)

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

4 participants