Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/async_web_server_cpp/http_connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class HttpConnection : public boost::enable_shared_from_this<HttpConnection>,
ReadHandler;
typedef std::shared_ptr<const void> ResourcePtr;

explicit HttpConnection(boost::asio::io_service& io_service,
explicit HttpConnection(boost::asio::io_context& io_service,
HttpServerRequestHandler request_handler);

boost::asio::ip::tcp::socket& socket();
Expand Down Expand Up @@ -79,7 +79,7 @@ class HttpConnection : public boost::enable_shared_from_this<HttpConnection>,
void handle_write(const boost::system::error_code& e,
std::vector<ResourcePtr> resources);

boost::asio::io_service::strand strand_;
boost::asio::io_context::strand strand_;
boost::asio::ip::tcp::socket socket_;
HttpServerRequestHandler request_handler_;
boost::array<char, 8192> buffer_;
Expand Down
2 changes: 1 addition & 1 deletion include/async_web_server_cpp/http_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class HttpServer : private boost::noncopyable

void handle_accept(const boost::system::error_code& e);

boost::asio::io_service io_service_;
boost::asio::io_context io_service_;
boost::asio::ip::tcp::acceptor acceptor_;
std::size_t thread_pool_size_;
std::vector<boost::shared_ptr<boost::thread>> threads_;
Expand Down
2 changes: 1 addition & 1 deletion src/http_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace async_web_server_cpp
{

HttpConnection::HttpConnection(boost::asio::io_service& io_service,
HttpConnection::HttpConnection(boost::asio::io_context& io_service,
HttpServerRequestHandler handler)
: strand_(io_service), socket_(io_service), request_handler_(handler),
write_in_progress_(false)
Expand Down
6 changes: 2 additions & 4 deletions src/http_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ HttpServer::HttpServer(const std::string& address, const std::string& port,
{

boost::asio::ip::tcp::resolver resolver(io_service_);
boost::asio::ip::tcp::resolver::query query(
address, port, boost::asio::ip::resolver_query_base::flags());
boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query);
boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(address, port).begin();
acceptor_.open(endpoint.protocol());
acceptor_.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
acceptor_.bind(endpoint);
Expand All @@ -33,7 +31,7 @@ void HttpServer::run()
for (std::size_t i = 0; i < thread_pool_size_; ++i)
{
boost::shared_ptr<boost::thread> thread(new boost::thread(
boost::bind(&boost::asio::io_service::run, &io_service_)));
boost::bind(&boost::asio::io_context::run, &io_service_)));
threads_.push_back(thread);
}
}
Expand Down