Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Async read from Poco HTTPClientSession

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?

like image 912
Aviad Rozenhek Avatar asked Apr 29 '13 14:04

Aviad Rozenhek


1 Answers

Just an idea, Try to put your code inside a thread.

http://pocoproject.org/slides/130-Threads.pdf

Regards

like image 130
Cesar Ortiz Avatar answered Oct 13 '22 18:10

Cesar Ortiz