Similar to this question, but I'd like to communicate asynchronously using Pion.
I think I've figured out how to create a connection asynchronously:
pion::tcp::connection_ptr connection(new pion::tcp::connection(_io_service));
connection->async_connect(ep,
boost::bind(&http_client::after_connect,
this,
connection,
_1));
Now I'd like to send a request using pion::http::request, but all of its send methods are blocking. How do I send asynchronously?
There is a
request_writerclass in Pion. As I remember it has asend()member function to send data asynchronously.