| 44 | } |
| 45 | |
| 46 | void server(boost::asio::io_context& io_context, unsigned short port) |
| 47 | { |
| 48 | tcp::acceptor a(io_context, tcp::endpoint(tcp::v4(), port)); |
| 49 | for (;;) |
| 50 | { |
| 51 | tcp::socket sock(io_context); |
| 52 | a.accept(sock); |
| 53 | std::thread(session, std::move(sock)).detach(); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | int main(int argc, char* argv[]) |
| 58 | { |