Jeff
2008-05-17 12:09:50 UTC
Hi
I have very little experience of Http programming and wondered if anyone
could advise me about what happens and when it happens behind the scenes
when I use CInternetSession::OpenUrl. Specifically, I'm wondering about when
bytes are actually available for reading. The background is that I want to
download and display a progressive jpeg. I'm using a file pointer obtained
with the following code:-
iSession = new CInternetSession (_T("Zoom Viewer/1.0"), 1,
PRE_CONFIG_INTERNET_ACCESS, NULL, NULL, INTERNET_FLAG_DONT_CACHE);
iStream = iSession->OpenURL(urlName, 1, INTERNET_FLAG_TRANSFER_BINARY, NULL,
0);
I'd like to begin displaying the progressive jpeg as soon as the bytes
arrive, however I'm not sure if the mechanism I'm using actually buffers the
entire Url before I get the first byte with an iStream->Read(....). If it
does then I might as well read the whole jpeg and be done with it.
The other question I have concerns doing an iStream->Seek(..) followed by an
iStream->Read(...). In this case the Url must surely be downloaded entirely
(or at least as far as the Seek) ??
Is there any mechanism for getting specific bytes from a Url without
customised server side code? And what would be the usual mechanism for
displaying progressive jpegs?
Thanks a lot
Jeff
I have very little experience of Http programming and wondered if anyone
could advise me about what happens and when it happens behind the scenes
when I use CInternetSession::OpenUrl. Specifically, I'm wondering about when
bytes are actually available for reading. The background is that I want to
download and display a progressive jpeg. I'm using a file pointer obtained
with the following code:-
iSession = new CInternetSession (_T("Zoom Viewer/1.0"), 1,
PRE_CONFIG_INTERNET_ACCESS, NULL, NULL, INTERNET_FLAG_DONT_CACHE);
iStream = iSession->OpenURL(urlName, 1, INTERNET_FLAG_TRANSFER_BINARY, NULL,
0);
I'd like to begin displaying the progressive jpeg as soon as the bytes
arrive, however I'm not sure if the mechanism I'm using actually buffers the
entire Url before I get the first byte with an iStream->Read(....). If it
does then I might as well read the whole jpeg and be done with it.
The other question I have concerns doing an iStream->Seek(..) followed by an
iStream->Read(...). In this case the Url must surely be downloaded entirely
(or at least as far as the Seek) ??
Is there any mechanism for getting specific bytes from a Url without
customised server side code? And what would be the usual mechanism for
displaying progressive jpegs?
Thanks a lot
Jeff