mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
complete simple connection implementation
This commit is contained in:
parent
3933baccd2
commit
fb0f4bff52
4 changed files with 164 additions and 59 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue