#include "client.h" #include CClient::CClient(const std::shared_ptr& logger) : logger_(logger) { client_ = std::make_shared(io_context_, logger_); } CClient::~CClient() { } void CClient::run() { std::thread thread([this]() { io_context_.run(); }); char line[512]{}; while (std::cin.getline(line, 512)) { if (std::strstr(line, "end")) { break; } } client_->disconnect(); thread.join(); logger_->info("{} exit.", __FUNCTION__); }