I found the answer for this. SO_RCVTIMEO is used to set the receive socket timeout in linux. This can be achieved using "setsockopt" API in linux. Similarly you have SO_SNDTIMEO to set the send socket timeout in linux. This can be achieved using "getsockopt" API in linux.
More details: (http://man7.org/linux/man-pages/man2/setsockopt.2.html)