#include #include #include #include #include #include int main( int argc, char** argv) { TCPClient client; auto res = client.Connect("209.51.188.116", 80); if (!res) { std::cerr << res.error() << std::endl; return 1; } auto wSize = client.Write("GET / HTTP/1.1\n\n\n"); if (!wSize) { std::cerr << wSize.error() << std::endl; return 1; } std::string buffer; auto rSize = client.Read(buffer, 8); if (!rSize) { std::cerr << rSize.error() << std::endl; return 1; } std::cout << std::format("read {} bytes", rSize.value()) << std::endl; std::cout << std::format("{}", buffer) << std::endl; }