Вот код: < /p>
Код: Выделить всё
#include
#include
namespace asio = boost::asio;
using asio::ip::tcp;
int main() {
using boost::system::error_code;
asio::io_context ctx;
tcp::acceptor acceptor(ctx, tcp::endpoint(tcp::v4(), 8080));
tcp::socket socket(ctx);
char buffer[100];
// accept handler
std::function accept_handler = [&](error_code ec) {
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79770483/why-does-asio-tcp-server-crash-after-the-first-async-read[/url]
Мобильная версия