Ken, > Fantastic response Mark, thank you.
You're welcome.
In the code provided, the HTTP response code will be a from the proxy f
itself or passed through from the origin server. To be safe, if you do
not get a 200 success code, then just accept that it's an error.
> For the record the generic C# connections for Microsoft are apparently:
Are these the ones you're talking about?
http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx
http://msdn.microsoft.com/en-us/library/system.net.http.httpclient.aspx
> a) restricted to 2 at a time.
http://www.danielroot.info/2009/02/improve-net-web-client-performance-by.html
> b) try and resolve the proxy every single time using the complex
> proxy settings under windows.
http://stackoverflow.com/questions/4415443/system-net-webclient-unreasonably-slow
> c) just generally perform badly.
You should not need to resort to sockets in order to do a basic web
request. There are good packages in any real production language, for
example, Go, Perl, Python and Java:
http://golang.org/pkg/net/http
http://search.cpan.org/perldoc?WWW%3A%3AMechanize
http://docs.python.org/3/library/urllib.request.html
http://hc.apache.org/
If this code is for "production", I'd find a proper package to
handle all the complexity of http. Otherwise, you'll find that
over time you end up writing more than you want to maintain ;)
> I grabbed some code of the internet with direct connection using
> sockets and run times dropped from approx 23 seconds to 11 seconds.
Even 11 seconds sounds way too long. What's the time for a
simple curl on the command line?
--
Mark Suter http://zwitterion.org/ | I have often regretted my
email addr <[email protected]> | speech, never my silence.
mobile 0411 262 316 gpg FB1BA7E9 | Xenocrates (396-314 B.C.)
signature.asc
Description: Digital signature
-- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
