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

Queue size in read #14

Closed
ErniBrown opened this issue Feb 27, 2024 · 2 comments · Fixed by #15
Closed

Queue size in read #14

ErniBrown opened this issue Feb 27, 2024 · 2 comments · Fixed by #15
Assignees
Labels
bug Something isn't working

Comments

@ErniBrown
Copy link
Contributor

_queueSize = select(_socketFd + 1, &readFileDescriptors, 0, 0, &waitTime);

There's an error here. Select does not return the size of the queue, only the number of file descriptors that are ready for reading/writing. So if you want to read all the messages you need to repeat the readMessage until it returns 0 bytes read. Or maybe you can do a ioctl call to FIONREAD, but I have not tested this

https://man7.org/linux/man-pages/man2/select.2.html

@SimonCahill
Copy link
Owner

You're absolutely right.

I'll see when I have time to sort this out.

Thanks for the heads-up!

@SimonCahill SimonCahill self-assigned this Feb 27, 2024
@SimonCahill SimonCahill added the bug Something isn't working label Feb 27, 2024
@SimonCahill
Copy link
Owner

I have made the necessary changes to the devel branch for this issue. I'll try and test the changes in the next few days.

If you have the time and can test it, I'd be grateful!

@SimonCahill SimonCahill linked a pull request Mar 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants