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?