Yes the call to select will return -1 if there is a problem with one of the sockets.

Since you are using blocking sockets, you had best not close the socket from a seperate thread.

In non-blocking scenarios it is much easier to handle this gracefully, by simply setting the timeout on the select to zero.

Note the flow chart for select states.

http://publib.boulder.ibm.com/infoce...6xnonblock.htm