fjpanag commented on PR #9497: URL: https://github.com/apache/nuttx/pull/9497#issuecomment-1600630934
@hujun260 I am sorry but I haven't been able to create a minimum working example yet. I working on it, but I have limited availability. I am currently testing on sim, using [this](https://github.com/fjpanag/code_for_nuttx/tree/main/mqtt_broker) server. I think I did some more progress though... Check [this](https://github.com/fjpanag/code_for_nuttx/blob/main/mqtt_broker/mqtt_br_server.c#L157) line. This fails before `select()` fails. The thing is that `socket()` returns a protected file descriptor. However, `FD_ISSET()` is checking on an unprotected descriptor, as seen [here](https://github.com/apache/nuttx/blob/master/include/sys/select.h#L83). So, although my server descriptor is for example 7172 (0x1C04), `FD_ISSET()` returns true when checking for fd = 4. I changed the above line to: ``` if (sd == fdcheck_restore(broker->server.sd)) ``` and I was able to move forward a bit. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
