Do we have any examples of using tcp in non blocking mode for the NRF9160. I used the USP for PSM example as base for my current project but the blocking call seems to lead to an issue.
Do we have any examples of using tcp in non blocking mode for the NRF9160. I used the USP for PSM example as base for my current project but the blocking call seems to lead to an issue.
Hi,
Are you setting up the socket to be non-blocking via fcntl()?
int flags = fcntl(client_fd, F_GETFL); fcntl(my_fd, F_SETFL, flags | O_NONBLOCK);
Kind regards,
Håkon
yes, setting it is not the issue. I figured it out a little while after posting the ticket. Just wondering if there is any way to get an interrupt when new data is available for reading or do we have to poll.
Hi,
I'm glad to hear that you found a workaround.
vchhabra said:Just wondering if there is any way to get an interrupt when new data is available for reading or do we have to poll.
A thread with poll() is the way to go. This will essentially be triggered from the modem (via a interrupt) when new data is received (or timeout occurs).
Kind regards,
Håkon