can recv be set to non-block mode use setsockopt?
in my code ,I tried the following two methoded,but the recv both work in blocking mode
sock=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
1)
short receiv_nonBlocking = 0;
setsockopt(sock, SOL_SOCKET, SOCKOPT_RECV_NONBLOCK , &receiv_nonBlocking, sizeof(receiv_nonBlocking));
2) unsigned long timeoutvalue = 0;
setsockopt(sock, SOL_SOCKET, SOCKOPT_RECV_TIMEOUT , &timeoutvalue , sizeof(timeoutvalue ));
is there any wrong in my code above? why I can't set recv in non-blocking mode?