allow to set buffer size for server

This commit is contained in:
Chunting Gu
2020-12-21 17:53:36 +08:00
parent ca83869912
commit c2f3a87cd2
7 changed files with 26 additions and 12 deletions
+3 -1
View File
@@ -23,6 +23,7 @@ Server::Server(boost::asio::ip::tcp protocol, std::uint16_t port,
: protocol_(protocol),
port_(port),
doc_root_(doc_root),
buffer_size_(kBufferSize),
file_chunk_size_(1024),
running_(false),
acceptor_(io_context_),
@@ -173,7 +174,8 @@ void Server::AsyncAccept() {
_2, _3);
auto connection = std::make_shared<Connection>(
std::move(socket), &pool_, &queue_, std::move(view_matcher));
std::move(socket), &pool_, &queue_, std::move(view_matcher),
buffer_size_);
pool_.Start(connection);
}