Created
March 5, 2015 06:46
-
-
Save vinipsmaker/aa9cec30257fef018a03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::future<void> tcp_reader(int total) | |
{ | |
char buf[64 * 1024]; | |
auto conn = await Tcp::Connect("127.0.0.1", 1337); | |
do | |
{ | |
auto bytesRead = await conn.read(buf, sizeof(buf)); | |
total -= bytesRead; | |
} | |
while (total > 0); | |
} | |
int main() { tcp_reader(1000 * 1000 * 1000).get(); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment