Created
July 11, 2012 10:53
-
-
Save kennethho/3089638 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
void handle_read(const sys::error_code& error, | |
size_t bytes_transferred) | |
{ | |
if(error) | |
{ | |
delete this; | |
return; | |
} | |
async_write( | |
socket_, | |
buffer(data_, bytes_transferred), | |
[this](const sys::error_code& error, size_t bytes_transferred) | |
{ | |
if(error) | |
{ | |
delete this; | |
return; | |
} | |
socket_.async_read_some( | |
buffer(data_, max_length), | |
bind(&session::handle_read, this, | |
placeholders::error, | |
placeholders::bytes_transferred)); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment