clean up dead connections regularly
This commit is contained in:
@@ -275,7 +275,11 @@ void Network::run() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
int cleanupCnt = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
if (++cleanupCnt > 10) {
|
||||||
|
cleanConnections();
|
||||||
|
}
|
||||||
#ifdef HAVE_PPOLL
|
#ifdef HAVE_PPOLL
|
||||||
// wait for new fd event
|
// wait for new fd event
|
||||||
ret = ppoll(fds, nfds, &tdiff, nullptr);
|
ret = ppoll(fds, nfds, &tdiff, nullptr);
|
||||||
@@ -289,6 +293,7 @@ void Network::run() {
|
|||||||
#endif
|
#endif
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
cleanConnections();
|
cleanConnections();
|
||||||
|
cleanupCnt = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bool newData = false, isHttp = false;
|
bool newData = false, isHttp = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user