I read from socket using recv function. I have problem when no data available for reading. My programm just stops. I found that I can set timeout using se
recv
se
use the FD_ISSET() macro to test whether there is data to read. If it returns false, don't do the read.
http://linux.die.net/man/3/fd_set