In article <11**********************@o13g2000cwo.googlegroups .com>,
pr***************@gmail.com <pr***************@gmail.com> wrote:
I am using the select call to read from many sockets. I don't want to
call read on every socket to check if it is closed, as it defeats the
purpose of using the select call.
Is there any way to know whether one of the sockets have been closed,
without actually testing each socket.
select() is not one of the routines defined by the C standards.
It is therefore not generally considered to be on-topic here.
We wouldn't be able to answer your question without knowing
the operating system (and version) .
If your OS considers the closing of a socket to be an
"exceptional condition" then you may be able to examine the
exception bitset and check only the fds marked as being in exception.
Some would argue, though, that close is a normal condition, not
an exceptional one (exceptional might be things like a TCP RST
or a pipe closing), so you would need to check the details
for whichever operating system you happen to be using (which you
have left us to guess...)
--
Are we *there* yet??