8

使用 HTTPClientSession 的通常示例代码如下所示:

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);

问题是,如何从 rs 输入流中读取整个数据,同时确保所有操作都是非阻塞的,以便我可以随时取消它们?

4

1 回答 1

3

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

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

Regards

于 2013-04-29T15:43:15.520 回答