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
mosquitto_loop return MOSQ_ERR_INVAL #1299
Comments
Are you using >1024 open files/sockets elsewhere? What platform are you running on? |
yes, socket fd > 1024. and our system is centos6.5. |
Any updates on this one? I have the same problem. I have two scenarios:
OS: Ubuntu 18.04 Any ideas? Regards, |
@nedo99 are you using a lot of fds in your user application? are you using mosquitto_loop()? If you are using a lot of fds in your own app, at least a workaround would be to use the mosquitto_loop_read, mosquitto_loop_write and mosquitto_loop_misc calls from your own fd handling mainloop (presumably then using (e)poll or one of the event libs) if you're not using a lot of fds in your application, could you provide some more details? |
@karlp yes we are using quite some fds. Not sure about the exact number. The only problem with read and write loops is that they are blocking calls and if there is a lot of data we cannot afford being blocked since sending data is not the highest priority. |
Any other input? |
I found a workaround for my case. I just put mosquitto initialization to be one of the first things in the code to get a valid socket (<1024). IMO, this is the bug in the |
Hello, |
Our program use mosquitto library to connect MQTT server.
When we call mosquitto_loop(), this function may returns MOSQ_ERR_INVAL.
And we find that mosq->sock is bigger than FD_SETSIZE(1024).
can you fix this issue?
Thanks!
The text was updated successfully, but these errors were encountered: