Please,
some can explain how to use isPending(pendingError) to realize
that the other end of the socket is disconnected?
I'm trying this:
setKeepAlive() ;
while(!isPending(pendingError,0)) {
if(isPending(pendingInput)) {
nBytesAvail = peek(str,500);
nBytesRead = readData(str,nBytesAvail);
if(nBytesAvail > 0) {
....
}
else break; // if this break is missing, it doesn't
realize that the connection is down, but loops forever, so
isPending(pendingError,0) doesn't work
}
}
If the client disconnects because a network error, the only way to know that
is to reduce the /proc/sys/net/ipv4/tcp_keepalive_time to 30
and tcp_keepalive_probe to 3 (has already suggested by someone in this list)
Is there a way to work better?
I tried to while(1) instead of while(!isPending(pendingError,0)) and if
works in the
same way...is it right? so how to use isPending(pendingError)?
Thanks in advance
_______________________________________________
Bug-commoncpp mailing list
Bug-commoncpp@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-commoncpp