Skip to content

Commit

Permalink
revised network clean logic
Browse files Browse the repository at this point in the history
  • Loading branch information
cheniujh committed Aug 9, 2024
1 parent 511d7b4 commit 29fcc56
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/net/src/worker_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ void WorkerThread::DoCronTask() {
}
conns_.clear();
deleting_conn_ipport_.clear();
return;
}

auto iter = conns_.begin();
Expand Down Expand Up @@ -272,13 +273,10 @@ void WorkerThread::DoCronTask() {
++iter;
}
}

for (const auto& conn : to_close) {
net_multiplexer_->NetDelEvent(conn->fd(), 0);
CloseFd(conn);
}
for (const auto& conn : to_timeout) {
net_multiplexer_->NetDelEvent(conn->fd(), 0);
CloseFd(conn);
server_thread_->handle_->FdTimeoutHandle(conn->fd(), conn->ip_port());
}
Expand Down

0 comments on commit 29fcc56

Please sign in to comment.