I use the device of omapl138. I use the NDK project to access UDP transmission, and I want to set the socket option to Non-blocking I/O mode. Because the NDK's default is
blocking I/O mode.
When I use the default mode, it seems that process is blocked by recvfrom() function if there is no data sent by the other device without function call of sendto().
May I use the setsockopt() function to set the SO_BLOCKING flag to achieve this. Is there anyone used to it before?
sockblk = 0;
setsockopt(snd,SOL_SOCKET,SO_BLOCKING,&sockblk,sizeof(sockblk)); /* set socket to nonblocking */
snd is the socket which I declare.
I use the above code to set the socket non-block. And I work with the TI's NDK project. But the network doesn't build up after the setting.
If I don't add the three lines to set non-blocking socket. The network can build up.
Does anyone know how do I solve it?
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.