| 147 | } |
| 148 | |
| 149 | void TcpClientImpl::hangup() { |
| 150 | active_connections_.clear(); |
| 151 | targets_.clear(); |
| 152 | is_closing_ = true; |
| 153 | ref_cnt_--; |
| 154 | for (auto &it : out_queries_) { |
| 155 | td::actor::send_closure(it.second.get(), &TcpOutboundQuery::set_error, |
| 156 | td::Status::Error(ton::ErrorCode::cancelled, "hangup")); |
| 157 | } |
| 158 | try_stop(); |
| 159 | } |
| 160 | |
| 161 | void TcpClientImpl::try_stop() { |
| 162 | if (is_closing_ && ref_cnt_ == 0 && out_queries_.empty()) { |