the usual sample code for using HTTPClientSession goes something like this:
Poco::Net::HTTPClientSession session(uri.getHost(), uri.getPort());
std::ostream& ostr = session.sendRequest(req);
// Receive the response.
Poco::Net::HTTPResponse res;
std::istream& rs = session.receiveResponse(res);
the question is, how can I read from the rs input stream the entire data, while making sure that all of operations are non-blocking, so that I can cancel them at any time?
Just an idea, Try to put your code inside a thread.
http://pocoproject.org/slides/130-Threads.pdf
Regards
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With