1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Resolved Wininet: need some called ()s 'whatItDoes' info (beyond msdn docs)

Discussion in 'Networking (Hardware & Software)' started by ukuwi, 2013/04/19.

  1. 2013/04/19
    ukuwi

    ukuwi Inactive Thread Starter

    Joined:
    2008/07/31
    Messages:
    9
    Likes Received:
    0
    Need to get deeper understanding as to mechanics of a few Wininet funcs.

    1) Following setting up IE as the named user agent and getting HINTERNET handle or session handle via InternetOpen()
    I make call to InternetOpenUrl()
    which msdn states:
    • parse URL
    • establishes connection to server
    • prepares to download data mapped to by URL
    Finally, I make a series of InternetReadFile() calls.

    please assume approx 60kb web page mapped by URL and I supply 1kb buffer when making calls to InternetReadFile().

    My question
    Does the file get pre-downloaded prior to or during reading?
    such that read calls are fulfilled locally
    OR
    does the mapped URL behave like a file whereby only the # of bytes asked for gets requested from server and then loaded into my supplied buffer following receipt from net.

    Above is probably a mute point but my concern is to do ethical/non-intrusive html scraping.
    edit seems I'm trying to say that behaving like a human/browser would mean that the complete page would be requested [at once?] and my current method of 1kb chunks [assuming each read prompts a server transaction] could be seen as very intrusive.

    Basically not want to get highlighted as vermin and have the heavies knocking on my door some late night :eek:

    Your comments would help me to sleep easier!!!

    Cheers
     
    Last edited: 2013/04/19
  2. 2013/04/19
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    The MSDN page you linked to answers your question.

    InternetReadFile
     

  3. to hide this advert.

  4. 2013/04/20
    ukuwi

    ukuwi Inactive Thread Starter

    Joined:
    2008/07/31
    Messages:
    9
    Likes Received:
    0
    Apologies for not doing better research. Can't see the forest for the trees!
    Am not C||C++ etc. programmer but the primitive language I work in provides I/F for WinApi calls.
    A lot to take in perhaps, msdn is great resource, I must learn more - specifically like how to understand what I read :))
    Thanks for your time.
    Cheers
     
  5. 2013/04/20
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    TIP:

    Look just prior to that paragraph and find a work that is mis-understood or not fully understood. It can be any word. Reading passed a mis-understood term can cause one to "go blank" and then the text become incomprehensible.

    Technical material is loaded with technical terms and sometimes difficult to understand. I keep several computer dictionaries bookmarked so I can define terms when I need to. Or I just use google's definition function. Type this in google search to get any definition:
    Code:
    define:the term to be defined
     
  6. 2013/04/20
    ukuwi

    ukuwi Inactive Thread Starter

    Joined:
    2008/07/31
    Messages:
    9
    Likes Received:
    0
    Interesting..
    How about the previous sentence.
    "InternetReadFile operates much like the base ReadFile function, with a few exceptions. "
    I've just gone over the ReadFile doc (for the first time) and besides being a lot there, it highlights for me or let's say reinforces parts of InternetReadFile.

    Thanks for the tip. I am aware of and use now 'n then define:. How right you are.

    I manage to purchase out of circulation back copies of New Scientist from local library, which are a joy to pour over. I also have my very old but trusted Websters with me when I read them. It is used often.

    Your tip is a wakeup call. Complacency springs to mind... Well, there ya go. I've been in software since '60s and well, I used to take in doc contents with glee and thoroughly understand. Something must've changed (old age perhaps ;). No excuse of course!

    So glad you posted again - a win win for me I think :)

    Cheers
     
  7. 2013/04/21
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Thanks.
    Are you writing an app?
     
  8. 2013/04/21
    ukuwi

    ukuwi Inactive Thread Starter

    Joined:
    2008/07/31
    Messages:
    9
    Likes Received:
    0
    Always...!
    Always on (vps or better is target host), robot trading app for forex environment - MetaTrader and MQL4. The latter xlats to almost 15yrs * Annus horribilis. However, is just a hair shirt at times these days as one looses the 'edge' of real language syntax techniques and unfortunately even the ability to remember that one actually did, at one time earn ones crust from such beasties.

    So... yes, I needed to scrape/borrow some web page data once per day - time zone datums reflecting the softwares current time zone.

    I firmly believe too many fx hackers spend way too much time with gmt this and est that etc. Plenty of purveyors of such data which can be mapped off any time zone one wants. Read it in, parse it and hey presto... Course, is likely that sod's law comes into play as webmasters just love to mod the look 'n feel and that will destroy my parsing big time!

    My simpleton mind says markets open @08:00 and close @17:00 market local time or maybe +/- an hour.

    No biggie really, as after all these years I've woken up to the KISS idea that means virtually any system design will make profit. aka, my personal eureka light bulb moment if you will.

    Fed up with being smart and clever over this trading lark (me of the black box single functionality brigade). I am using many instances of same executable (well... interpreted src compiled into byte codes really).

    The epiphany manifests as massively dumb code that, well, produces profit and then stops until another market opens or we get market overlaps.
    All very mundane yet imho powerful in its dumbness.

    Most who dabble or otherwise/whatever, in financial arenas are always bouncing between fear and greed. Greed being the killer imo. So I, as it were, just cream off the top many times per day which equates to massive and consistent summation of small profits. (keyWd being consistent)

    The greed button would have me stay longer in a profitable [or so it would appear] trade.

    My dumb way is to say no thanks, I'll take the profit I have.
    Now replicate that around 40 times per day and factor in compounding and well - the figures become very interesting...

    xcuse the ramble, but after all this time I tend to.. Only contact is monitor and constant visits to local forest for renewal of pit props to shore up an increasingly degrading mind/skill set.

    Is all a game for sure... yet I do value what projects I once worked on and the contributions I made. It's just that now... I realise that those 'days' are very much just memories.

    'now' in reality is much more interesting anyway, yes?

    I absolutely love ditch digging cuz the skill set is so deeply embedded, I know I'll get there (what once was done in minutes now takes hours/days), just keep hammer 'n chiseling away (my own stepwise refinement as it were;) The mind stuff is another matter and the concentration soon ebbs!

    Oh yes, your question - rambled on about above I guess. Ever heard of Euphoria? A language which intrigues me yet for sure is not big deal I imagine. Then there's Lua. Oh yes, not forgetting Miranda, parent of Haskell... the functional programming arena, trouble is never good at maths! But just kinda looks fun.

    Great thing for everyone these days is that its ALL out there. Repleat with docs, compilers, assemblers and the forums!

    Sorry... must go.
    Cheers
    :eek:

    ps, really do appreciate your tip as good to get kick up the a*s now 'n then. Reality check for me. Must concentrate on each word...
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.