winInet cache

This is a discussion on winInet cache within the Networking/Device Communication forums, part of the General Programming Boards category; hi all, im using the wininet library to download files from the net--web cam pics to be precise and the ...

  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    1

    winInet cache

    hi all,
    im using the wininet library to download files from the net--web cam pics to be precise and the problem is, after downloading a pic once i always get the same pic in later trys. seems to have to do with windows internal buffering. while the pic of the webcam obviously changes all the time, the InternetReadFile() only gives me the pic which is already in the buffer.
    i've tried to close and reopen the whole session with InternetOpen() and InternetCloseHandle() but same result. only way is restarting the program.
    is there any way to clear that damn cache??
    thanks

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,555
    At a guess, the webcam is using a streaming protocol, and you need a different API.

    AFAIK, InternetReadFile() is for content whose size can be determined in advance.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    You could try one of the cache flags in your call to InternetOpenUrl or HttpOpenRequest: INTERNET_FLAG_RELOAD or INTERNET_FLAG_PRAGMA_NOCACHE.

  4. #4
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Quote Originally Posted by Salem View Post
    AFAIK, InternetReadFile() is for content whose size can be determined in advance.
    Not true, i use InternetReadFile() to GET streaming video and it works just fine. I believe you want to use
    INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_PRAGMA_NOCACHE
    for streaming content though.
    Code:
    hRequest = HttpOpenRequest( hConnection , NULL , (char *)&szFile , NULL , NULL , (const char **)lpMIME , INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_PRAGMA_NOCACHE , 0 );
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. need help with cache simulator!
    By dtogers123 in forum C Programming
    Replies: 3
    Last Post: 04-30-2008, 06:18 PM
  2. ideas requested for a CACHE.
    By bean66 in forum C Programming
    Replies: 2
    Last Post: 02-21-2008, 10:01 AM
  3. Resource manager tree
    By VirtualAce in forum Game Programming
    Replies: 23
    Last Post: 09-07-2007, 10:27 PM
  4. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  5. cache miss/hit
    By xddxogm3 in forum C++ Programming
    Replies: 3
    Last Post: 05-07-2007, 06:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21