Article View: borland.public.cppbuilder.internet.socket
Article #1198Re: WSAGetLastError return always 6
From: Eduardo Jauch
Date: Tue, 27 Feb 2007 23:39
Date: Tue, 27 Feb 2007 23:39
78 lines
4518 bytes
4518 bytes
Remy Lebeau (TeamB) escreveu: > Doesn't matter. You still have to process the chunks properly. The > way you are reading the data, you are leaving all of that chunk > information inside your buffer. You will have to strip off all of > that info anyway when you go to process the contents of the downloaded > data later on. If you process the chunks while they are downloading, > as described earlier, then they won't be in your buffer at all when it > comes time to process it. > What I do is: Receive the whole data first. All of them is loaded into "html", that is a char []. What I really do is search the first "<select " on the page. When I find it, I look for the second "<option " (if it exists) and so on until I find the first "</select>" The only things I "use" is the "value=xxxxx" on the options... If I find a value interesting, I execute another GET (not show in my previous posts). Now, I do the same, but with the second "<select " on the page. These select's stay on the end of the html. When I first enter the page (via GET), the server load all the information for the 3 selects. But show only the information for the first. When I execute the second GET, what I'm doing is asking to server to fill the second select based on my selection (of the first). All the information don't change, even if one of the options is discarded or used by another user... So, I can iterate on the values until I find something useful and send a GET saying to the server that I want that information.If no one ask for it before me, I get, if not, the server say that the information dos not exist anymore. The "speed" to a desired info "vanish" is fewer than 1 second sometimes... BEcause all data is loaded by the server for me on the first GET, Only this is timing consuming, the other three GETS to ask the desired information togheder occour in fewer time than the first. So, If I can do a code that do this fewer than 1 sec I got more chances to achive the info. This is why I do such horrible code... And why I don't mind to read the chunked data etc... And because the information that I want always come only with the last chunk, I don't bother with the rest. In fact, I only keep the rest for security reasons. Because sometimes the data that came is bigger than normal, and some of that come in the chunk right before the last. It's a page generated automatically. Always the same, except for the options on the three selects. >> but to do this is time consuming. > > Not as much as you think. Besides, you are going to have to take the > time to process the chunk info anyway, so you may as well do it as > soon as they arrive. > Because I look for data that will come only 7000 bytes offset the begin of the body, specific data, and I don't bother if the page changes and my app will stop working for a few days until I rewrite the code, this is not so important exactly now. >> I first do a code that does something similarly... But the "speed" > was >> slower that if I "force" to do like I'm doing now :) > > You probably did not optimize the code once it was running. > Problably :)
Technical Details
Message-ID:
<45e4c107$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<45e24baa@newsgroups.borland.com> <45e31e54$1@newsgroups.borland.com> <45e34585$1@newsgroups.borland.com> <45e358b3$1@newsgroups.borland.com> <45e380bc@newsgroups.borland.com> <45e38fa2$1@newsgroups.borland.com> <45e3a6cf@newsgroups.borland.com> <45e3d748@newsgroups.borland.com> <45e4284e$1@newsgroups.borland.com> <45e47101$1@newsgroups.borland.com> <45e4a68c$1@newsgroups.borland.com> <45e4b0c8$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,ead06e5a7c488245 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Tue, 27 Feb 2007 20:39:46 -0300 From: Eduardo Jauch <eduardo.jauch@gmail.com> User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: WSAGetLastError return always 6 References: <45e24baa@newsgroups.borland.com> <45e31e54$1@newsgroups.borland.com> <45e34585$1@newsgroups.borland.com> <45e358b3$1@newsgroups.borland.com> <45e380bc@newsgroups.borland.com> <45e38fa2$1@newsgroups.borland.com> <45e3a6cf@newsgroups.borland.com> <45e3d748@newsgroups.borland.com> <45e4284e$1@newsgroups.borland.com> <45e47101$1@newsgroups.borland.com> <45e4a68c$1@newsgroups.borland.com> <45e4b0c8$1@newsgroups.borland.com> In-Reply-To: <45e4b0c8$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 201.14.27.130 Message-ID: <45e4c107$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1172619527 201.14.27.130 (27 Feb 2007 15:38:47 -0800) Lines: 78 Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail