I need to enable a receive timeout in a sockets program.
I have researched this on the net and found that using the SO_RCVTIMEO
option in the SetSockOpt function, but am not sure how to setup the values
and pass them to it.
This is the code that I have found:
tv.tv_sec = 30; /* 30 Secs Timeout */
tv.tv_usec = 0; // Not init'ing this can cause strange errors
setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv,sizeof(struct
What I am not sure of is how to pass the values shown after the SO_RCVTIMEO.
Sr. Programmer Analyst