From: Max M. <ma...@kt...> - 2011-01-21 15:59:43
|
Hi everybody, Perhaps I've missed some vital information or link, but it seems to difficult to find any extensive documentation at all about the specific capabilities of the cpp-netlib, so I guess I'll go ahead and ask here and either you can help me directly, post a link to extensive documentation, or ignore. I've already viewed http://cpp-netlib.github.com/reference_http_response.html#response-concept and http://cpp-netlib.github.com/reference_http_client.html. I'm trying to use the cpp-netlib to forward live http streams, such as when broadcasting from a webcam or similar, so I am trying to use both the server and client components asynchronously. As far as I can see, this is working fine for the server. However, when it comes to the asynchronous client, I would like to do this: client::request clientRequest(reqUrl); client::response clientResponse; clientResponse = clnt.get(clientRequest); strtype result; while(!(result = clientResponse.body()).empty()) { std::cout << result << std::endl; connection->write(boost::make_iterator_range(result)); } Idiomatically this is pretty easy to understand, assuming that clientResponse.body() returns the bytes already read from the response, and that empty returns true when no more bytes can be read. This does not work (but I thought it was worth a try when I had no idea about the implementation ;) ) Is it possible with the current API to simulate this behaviour? I saw an issue about implementing client streams, but I thought, it can't hurt to ask? Thanks for your time. Best regards, Max Malmgren |