Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::future<ptrdiff_t> tcp_reader(int total)
- {
- char bug[64 * 1024];
- ptrdiff_t result = 0;
- auto conn = await Tcp::Connect("127.0.0.1", 1337);
- do
- {
- auto bytesRead = await conn.Read(buf, sizeof(buf));
- total -= bytesRead;
- result += std::count(buf, buf + bytesRead, 'c');
- }
- while (total > 0);
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement