Client::close renamed to Client::stop

This commit is contained in:
eidheim 2017-07-07 23:19:15 +02:00
commit 490e33e2d1
2 changed files with 3 additions and 3 deletions

View file

@ -352,7 +352,7 @@ namespace SimpleWeb {
} }
/// Close connections /// Close connections
void close() { void stop() {
std::unique_lock<std::mutex> lock(connections_mutex); std::unique_lock<std::mutex> lock(connections_mutex);
for(auto it = connections.begin(); it != connections.end();) { for(auto it = connections.begin(); it != connections.end();) {
(*it)->attempt_reconnect = false; (*it)->attempt_reconnect = false;
@ -366,7 +366,7 @@ namespace SimpleWeb {
auto lock = cancel_callbacks_mutex->unique_lock(); auto lock = cancel_callbacks_mutex->unique_lock();
*cancel_callbacks = true; *cancel_callbacks = true;
} }
close(); stop();
} }
protected: protected:

View file

@ -350,7 +350,7 @@ int main() {
io_service->run(); io_service->run();
}); });
this_thread::sleep_for(chrono::milliseconds(100)); this_thread::sleep_for(chrono::milliseconds(100));
client.close(); client.stop();
this_thread::sleep_for(chrono::milliseconds(100)); this_thread::sleep_for(chrono::milliseconds(100));
thread.join(); thread.join();
assert(call); assert(call);