complete simple connection implementation
This commit is contained in:
@@ -18,16 +18,6 @@ TEST(curltest, curltest) {
|
||||
std::cout << value << std::endl;
|
||||
}, [](auto){}
|
||||
);
|
||||
if (true) {
|
||||
auto socket = network->getConnection(network->connect("google.com", 80));
|
||||
const char* string = "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n";
|
||||
socket->send(string, strlen(string));
|
||||
char data[1024];
|
||||
|
||||
int len = socket->recv(data, 1024);
|
||||
std::cout << len << " " << std::string(data, len) << std::endl;
|
||||
}
|
||||
|
||||
std::cout << "upload: " << network->getTotalUpload() << " B" << std::endl;
|
||||
std::cout << "download: " << network->getTotalDownload() << " B" << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user