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.
Tool/software: TI-RTOS
Hello everyone. We use DaemonNew example In MCSDK, which c6678 to be a tcp server. It can send and receive data successfully.
Now we'd like to change recv() to non-blocking mode, and we use the following code:
int sockblk = 0;
setsockopt(s, SOL_SOCKET, SO_BLOCKING, &sockblk, sizeof(sockblk));
However, the recv() returns -1 at once everytime, whatever the client send, the recv buffer is always 0.
It cannot receive data correctly. We use fdError() to see the error code is 35, whicn means EWOULDBLOCK.
So my question is, How to successfully config the recv() to non-blocking mode and receive tcp data?
Thank you for your reply.
Yes, I tried. There is no difference in the result. I always got -1, and no data received.
Is there any extra steps need to be done?