2009-10-07 2 views

Répondre

8
m_socket = boost::asio::ip::tcp::socket(io_service); 
boost::asio::streambuf replyBuf; 
... 
... 
boost::asio::read_until(m_socket, replyBuf, '\0'); 

Et si vous voulez transformer le streambuf à une chaîne:

std::string retVal((std::istreambuf_iterator<char>(&replyBuf)), 
         std::istreambuf_iterator<char>()); 
Questions connexes