65,186
社区成员




void handle_read(char *buf,boost::system::error_code ec,
std::size_t bytes_transferred)
{
cout.write(buf, bytes_transferred);
}
void handle_read(char *buf,std::string *out,boost::system::error_code ec,
std::size_t bytes_transferred)
{
out->assign(buf, buf+bytes_transferred);
}
async_read(sp, buffer(buf), boost::bind(handle_read, buf, _1, _2));
std::string strOut;
async_read(sp, buffer(buf), boost::bind(handle_read, buf, &strOut, _1, _2));