This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
TM4C1294NCPDT running the TCPEcho example from TiRTOS examples. Runs nicely and is easy to understand.
I'm new to threads and semaphores etc. How do I use the send() from elsewhere in my code?
The recv() blocks the thread. I can set this to unblocking, but then the send() may get called with length 0, and what makes the thread wait?
It must be a common problem, can you point me at an example please.
Thanks
Richard
Using the BSD socket API under Unix, it is possible to have a single thread perform IO on multiple sockets by setting the sockets to non-blocking and then using the select() or poll() for one or more sockets to be readable (or read error pending) or writable (or send error pending).Richard Bland said:The recv() blocks the thread. I can set this to unblocking, but then the send() may get called with length 0, and what makes the thread wait?
Unlike Unix TI-RTOS doesn't have built-in support for file descriptors. However, the TI Network Developer's Kit does have a File Descriptor Environment and BSD Sockets Compatibility API Layer to give the equivalent of the select() and poll() functions. See the Sockets and Stream IO API chapter of www.ti.com/lit/pdf/spru524