| 170 | } |
| 171 | |
| 172 | void TCPServerImpl::closeAllConnections(const Error& error) { |
| 173 | while (true) { |
| 174 | Ref<TCPServerConnectionImpl> connection; |
| 175 | |
| 176 | { |
| 177 | std::lock_guard<Mutex> guard(_mutex); |
| 178 | if (_connections.empty()) { |
| 179 | return; |
| 180 | } |
| 181 | connection = *_connections.begin(); |
| 182 | } |
| 183 | |
| 184 | connection->close(error); |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | void TCPServerImpl::appendConnection(const Ref<TCPServerConnectionImpl>& connection) { |
| 189 | std::lock_guard<Mutex> guard(_mutex); |
no test coverage detected