This may be a super simple question, but for the life of me I can't find any sources to answer it on Google or I've read something that confused me.

I'm communicating with a server that requires I send it a handle name for my connection, depending on some rules on handle formatting it either accepts/rejects me. The thing is that it rejects me WITHOUT notifying that it's ending the connection.

My question is...is there any way I can detect that the socket has closed? I read a forum that said I can use descr() to feed in the file discriptor but other sources are saying that there is effectively no way of knowing if the socket is still open or not - which doesn't make sense to me (seems like that can't possibly be true).

Thanks in advance.