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

使用socketio会收到两次消息回调 #563

Closed
springrider opened this issue Mar 10, 2017 · 2 comments
Closed

使用socketio会收到两次消息回调 #563

springrider opened this issue Mar 10, 2017 · 2 comments

Comments

@springrider
Copy link

https://github.com/cocos-creator/cocos2d-x-lite/blob/develop/cocos/network/SocketIO.cpp#L944
https://github.com/cocos-creator/cocos2d-x-lite/blob/develop/cocos/network/SocketIO.cpp#L945
不确定为什么这里这么些,但是这两行最终都会触发jsb的fireEventToScript方法,导致js那边通过
socket.on('message', function () {})监听的话,会被调用两次.

@dumganhar
Copy link
Contributor

看了代码,的确啊。。。

@dumganhar dumganhar self-assigned this Mar 13, 2017
@springrider springrider changed the title 使用socketio会收到两次消息会掉 使用socketio会收到两次消息回调 Mar 13, 2017
@jareguo
Copy link
Contributor

jareguo commented Apr 11, 2019

fixed

This issue was closed.
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

3 participants