I have a set of TCP sockets with keep-alive (1 min interval) controlled by a select(2) loop (select to read).
select(2)
read(2)
select()
read()
write(2)
The descriptor is considered read ready when the call to the input function with clearing O_NONBLOCK will not be blocked, regardless of whether the function successfully transfers data. (A function may return data, an indication of the end of a file, or an error other than one, indicating that it is locked, and in each of these cases the handle is considered read ready to be read.) [ POSIX: select () ]
ETIMEDOUT
EHOSTUNREACH
select() sets the bit to FDSET , which indicates which socket was started. Use the FD_ISSET macro to determine which socket the service requested.
FDSET