Skip to content

Commit

Permalink
Avoid exceptions while closing sockets
Browse files Browse the repository at this point in the history
  • Loading branch information
ipkn committed Dec 25, 2017
1 parent 05d02fe commit d1a30bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/crow/socket_adaptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ namespace crow

void close()
{
socket_.close();
boost::system::error_code ec;
socket_.close(ec);
}

template <typename F>
Expand Down Expand Up @@ -89,7 +90,8 @@ namespace crow

void close()
{
raw_socket().close();
boost::system::error_code ec;
raw_socket().close(ec);
}

boost::asio::io_service& get_io_service()
Expand Down

0 comments on commit d1a30bf

Please sign in to comment.