connection::thread_loop(): Try harder to catch dead sockets

This commit is contained in:
Petr Baudis 2011-11-29 19:46:33 +01:00
parent 04fc7b4b7a
commit 12724c016d

View file

@ -173,7 +173,7 @@ connection::thread_loop(void)
fd_set rfds;
FD_ZERO(&rfds);
FD_SET(fd, &rfds);
while (select(fd + 1, &rfds, NULL, NULL, &tv)) {
while (select(fd + 1, &rfds, NULL, &rfds, &tv)) {
char cbuf[1024];
len = read(fd, cbuf, sizeof(cbuf));
if (len < 0) {