| 2 | using namespace co_context; |
| 3 | |
| 4 | task<> session(int sockfd) { |
| 5 | co_context::socket sock{sockfd}; |
| 6 | char buf[8192]; |
| 7 | |
| 8 | while (true) { |
| 9 | int nr = co_await sock.recv(buf); |
| 10 | co_await sock.send({buf, (size_t)nr}); |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | task<> server(const uint16_t port) { |
| 15 | acceptor ac{inet_address{port}}; |