This commit is contained in:
Scott E. Graves 2024-12-16 10:33:25 -06:00
parent 6b58a0e0f7
commit dbf4a58807
2 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ namespace repertory {
void client_pool::pool::execute(
std::uint64_t thread_id, const worker_callback &worker,
const worker_complete_callback &worker_complete) {
const auto index = thread_id % pool_queues_.size();
auto index = thread_id % pool_queues_.size();
auto job = std::make_shared<work_item>(worker, worker_complete);
auto &pool_queue = pool_queues_[index];
@ -51,7 +51,7 @@ client_pool::pool::pool(std::uint8_t pool_size) {
for (std::size_t i = 0U; i < pool_queues_.size(); i++) {
pool_threads_.emplace_back([this]() {
const auto thread_index = thread_index_++;
auto thread_index = thread_index_++;
auto &pool_queue = pool_queues_[thread_index];
auto &queue = pool_queue->queue;
@ -74,7 +74,7 @@ client_pool::pool::pool(std::uint8_t pool_size) {
queue_lock.unlock();
try {
const auto result = item->work();
auto result = item->work();
item->work_complete(result);
} catch (const std::exception &e) {
item->work_complete(utils::from_api_error(api_error::error));

View File

@ -72,7 +72,7 @@ void packet_server::initialize(const uint16_t &port, uint8_t pool_size) {
server_thread_ = std::make_unique<std::thread>([this, port, pool_size]() {
tcp::acceptor acceptor(io_context_);
try {
const auto endpoint = tcp::endpoint(tcp::v4(), port);
auto endpoint = tcp::endpoint(tcp::v4(), port);
acceptor.open(endpoint.protocol());
acceptor.set_option(socket_base::reuse_address(true));
acceptor.bind(endpoint);
@ -148,7 +148,7 @@ void packet_server::read_packet(std::shared_ptr<connection> conn,
const auto read_buffer = [&]() {
std::uint32_t offset{};
while (offset < conn->buffer.size()) {
const auto bytes_read = boost::asio::read(
auto bytes_read = boost::asio::read(
conn->socket, boost::asio::buffer(&conn->buffer[offset],
conn->buffer.size() - offset));
if (bytes_read <= 0) {