You need to perform some socket operation for that. I think "select" call will work too. Just call the select function on socket for read, write and error with little timeout value (like 1 millisecond) and you can check if the socket is readable, writable or there is some error.
Of course if your socket descriptor is in Error FD_SET then its not alive, and if it is readable and writable it will be alive as well
Hope it works,
Regards,
--Tayyab