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

Repeated messages. #51

Open
edufgf opened this issue Jul 16, 2016 · 0 comments
Open

Repeated messages. #51

edufgf opened this issue Jul 16, 2016 · 0 comments

Comments

@edufgf
Copy link

edufgf commented Jul 16, 2016

Hi, I am using this lib to connect to a websocket.
I am getting duplicate messages sometimes, and I don't think the problem is the socket source (who sends the messages). Is there any known bug related to duplicate messages??

I'm on linux and using threads.

EDIT: I was reading the lib code, and I think I found this 'bug'. Actually the handle_message dispatch callback can run after a poll(-1) 'supposedly' blocking (maybe it really is) and return no new message.
The problem is that the dispatch function might not even call the callback function.
I suggest modifying the dispatch function, and make it indicate whether there was a new message read from the socket.

I was assuming that when once poll(-1) returns then a new message was there and it was read with dispatch, but it is not quite the case. The poll function waits on a "select" call and I don't know why it returns even when there isn't exactly a "full message" or something like that, because the dispatch function have conditions to check if we really have a message (or a message that is readable by the current implementation).

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

1 participant