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

file descriptors / select issue with large number of clients #34

Open
fgaultier opened this issue Jul 18, 2019 · 1 comment
Open

file descriptors / select issue with large number of clients #34

fgaultier opened this issue Jul 18, 2019 · 1 comment

Comments

@fgaultier
Copy link

With a large number of clients (above 20), some subscribing clients do not receive any message. The issue is related with implementation of the mqtt_sn_select function in mqtt-sn.c file. Consider replacing line 817:

ret = select(sock + 1, &rfd, NULL, NULL, &tv);

with the following:

ret = select(FD_SETSIZE, &rfd, NULL, NULL, &tv);

We tested the change and it works fine

@njh
Copy link
Owner

njh commented May 8, 2020

Sorry for not responding to this.

I presume that select() takes a nfds parameter, and doesn't just default to the maximum allowed number of file descriptors, for performance issues.

However I am not sure why when using a large number of subscribing clients, it doesn't work for you. Are the clients and the server all on the same machine?

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

2 participants