fix acceptor

This commit is contained in:
ubuntu
2022-08-21 17:22:54 +08:00
parent ddb298960a
commit adb0611932
+8 -5
View File
@@ -104,6 +104,10 @@ private:
}
acceptor_.async_accept(conn_->socket(), [this](asio::error_code ec) {
if (!acceptor_.is_open()) {
return;
}
if (ec) {
// LOG(INFO) << "acceptor error: " <<
// ec.message();
@@ -149,12 +153,11 @@ private:
for (auto it = sub_map_.cbegin(); it != sub_map_.cend();) {
auto conn = it->second.lock();
if (conn == nullptr || conn->has_closed()) {
//remove token
for (auto t = token_list_.begin(); t != token_list_.end(); ) {
// remove token
for (auto t = token_list_.begin(); t != token_list_.end();) {
if (it->first.find(*t) != std::string::npos) {
t = token_list_.erase(t);
}
else {
} else {
++t;
}
}
@@ -270,4 +273,4 @@ private:
} // namespace rpc_service
} // namespace rest_rpc
#endif // REST_RPC_RPC_SERVER_H_
#endif // REST_RPC_RPC_SERVER_H_