Made Server::stop exception safe
This commit is contained in:
parent
35ea8a950e
commit
1f474f377b
1 changed files with 2 additions and 1 deletions
|
|
@ -418,7 +418,8 @@ namespace SimpleWeb {
|
||||||
/// Stop accepting new requests, and close current connections.
|
/// Stop accepting new requests, and close current connections.
|
||||||
void stop() {
|
void stop() {
|
||||||
if(acceptor) {
|
if(acceptor) {
|
||||||
acceptor->close();
|
error_code ec;
|
||||||
|
acceptor->close(ec);
|
||||||
|
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(*connections_mutex);
|
std::unique_lock<std::mutex> lock(*connections_mutex);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue