feat(common): add Boost Asio aliases

Introduce aliases for Asio IP, TCP, UDP, and timer types to enhance code
readability and structure.
This commit is contained in:
Ваше Имя
2025-10-06 00:04:34 +04:00
parent 679d752177
commit 0d96c21199
+9 -4
View File
@@ -1,25 +1,30 @@
#pragma once
#include <boost/asio.hpp>
#include <boost/asio/ip/address.hpp>
#include <boost/program_options.hpp>
#include <boost/system/error_code.hpp>
// --- Error handling ---
using ErrorCode = boost::system::error_code;
// --- IO Context ---
// --- Asio types ---
using IoContext = boost::asio::io_context;
using SteadyTimer = boost::asio::steady_timer;
// --- TCP ---
// --- Ip types ---
using IpAddress = boost::asio::ip::address;
// --- TCP types ---
using TcpSocket = boost::asio::ip::tcp::socket;
using TcpAcceptor = boost::asio::ip::tcp::acceptor;
using TcpEndpoint = boost::asio::ip::tcp::endpoint;
// --- UDP (для DNS) ---
// --- UDP types ---
using UdpSocket = boost::asio::ip::udp::socket;
using UdpEndpoint = boost::asio::ip::udp::endpoint;
// --- Таймеры ---
// --- Timers ---
using SteadyTimer = boost::asio::steady_timer;
// --- Program options ---