Open fgaultier opened 5 years ago
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?
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