select() function hangs

I’m using select() function on my server side to detect if there is
something to read in the socket before i cal recv(), so my program wouldn’t
hang if there
is nothing to read on recv(). this works fine except that if the client
side is down, my server’s select() function call
hangs the whole program??? is ther some kind of function I can cal before
calling select()???